add MainMenu.Separator to the documentation

This commit is contained in:
みけCAT 2024-01-11 19:19:32 +09:00 committed by GitHub
parent 65047cc2cb
commit 490c370c74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -167,3 +167,27 @@ function App() {
| Prop | Type | Required | Default | Description |
| --- | --- | :-: | :-: | --- |
| `children ` | `React.ReactNode` | Yes | - | The content of the `Menu Group` |
### MainMenu.Separator
To put a horizontal line between items, you can use `MainMenu.Separator`.
```jsx live
function App() {
return (
<div style={{ height: "500px" }}>
<Excalidraw>
<MainMenu>
<MainMenu.Item onSelect={() => window.alert("Item1")}>
Item1
</MainMenu.Item>
<MainMenu.Separator />
<MainMenu.Item onSelect={() => window.alert("Item2")}>
Item 2
</MainMenu.Item>
</MainMenu>
</Excalidraw>
</div>
);
}
```