2020-07-15 21:30:37 +00:00
|
|
|
# Menu Label
|
|
|
|
|
|
|
|
[component-header:sl-menu-label]
|
|
|
|
|
|
|
|
Menu labels are used to describe a group of menu items.
|
|
|
|
|
|
|
|
```html preview
|
|
|
|
<sl-menu
|
2021-11-18 22:41:03 +00:00
|
|
|
style="max-width: 200px; border: solid 1px var(--sl-panel-border-color); background: var(--sl-panel-background-color); border-radius: var(--sl-border-radius-medium);"
|
2020-07-15 21:30:37 +00:00
|
|
|
>
|
|
|
|
<sl-menu-label>Fruits</sl-menu-label>
|
|
|
|
<sl-menu-item value="apple">Apple</sl-menu-item>
|
|
|
|
<sl-menu-item value="banana">Banana</sl-menu-item>
|
|
|
|
<sl-menu-item value="orange">Orange</sl-menu-item>
|
2021-09-29 12:03:03 +00:00
|
|
|
<sl-divider></sl-divider>
|
2020-07-15 21:30:37 +00:00
|
|
|
<sl-menu-label>Vegetables</sl-menu-label>
|
|
|
|
<sl-menu-item value="broccoli">Broccoli</sl-menu-item>
|
|
|
|
<sl-menu-item value="carrot">Carrot</sl-menu-item>
|
|
|
|
<sl-menu-item value="zucchini">Zucchini</sl-menu-item>
|
|
|
|
</sl-menu>
|
|
|
|
```
|
|
|
|
|
2021-11-04 22:12:47 +00:00
|
|
|
```jsx react
|
2022-03-02 15:10:41 +00:00
|
|
|
import { SlDivider, SlMenu, SlMenuLabel, SlMenuItem } from '@shoelace-style/shoelace/dist/react';
|
2021-11-04 22:12:47 +00:00
|
|
|
|
|
|
|
const App = () => (
|
2022-03-02 15:10:41 +00:00
|
|
|
<SlMenu
|
2021-11-04 22:12:47 +00:00
|
|
|
style={{
|
|
|
|
maxWidth: '200px',
|
2021-11-18 22:41:03 +00:00
|
|
|
border: 'solid 1px var(--sl-panel-border-color)',
|
2021-11-04 22:12:47 +00:00
|
|
|
borderRadius: 'var(--sl-border-radius-medium)'
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<SlMenuLabel>Fruits</SlMenuLabel>
|
|
|
|
<SlMenuItem value="apple">Apple</SlMenuItem>
|
|
|
|
<SlMenuItem value="banana">Banana</SlMenuItem>
|
|
|
|
<SlMenuItem value="orange">Orange</SlMenuItem>
|
|
|
|
<SlDivider />
|
|
|
|
<SlMenuLabel>Vegetables</SlMenuLabel>
|
|
|
|
<SlMenuItem value="broccoli">Broccoli</SlMenuItem>
|
|
|
|
<SlMenuItem value="carrot">Carrot</SlMenuItem>
|
|
|
|
<SlMenuItem value="zucchini">Zucchini</SlMenuItem>
|
2022-03-02 15:10:41 +00:00
|
|
|
</SlMenu>
|
2021-11-04 22:12:47 +00:00
|
|
|
);
|
|
|
|
```
|
|
|
|
|
2020-07-15 21:30:37 +00:00
|
|
|
[component-metadata:sl-menu-label]
|