MenuItem
An item within a menu.
Code
<script lang="ts">
import { MenuItem } from '@geoffcox/sterling-svelte';
</script>
<MenuItem text="sterling-svelte" value="menu-item-1">
<!-- <MenuItem> ... -->
</MenuItem>
Members
| Property Name | Type | Default | Comment |
---|
| checked | boolean | null | undefined | false |
| item | Snippet | undefined | undefined |
| menuClass | string | undefined | undefined |
| onClose | (value: string) => void | undefined |
| onOpen | (value: string) => void | undefined |
| onSelect | (value: string) => void | undefined |
| role | MenuItemRole | undefined | 'menuitem' |
| shortcut | string | undefined | undefined |
| text | string | undefined | undefined |
| value | string | |
Types
| Type Name | Definition | Comment |
---|
| MenuItemRole | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' |
Considerations
- Includes HTMLButtonElement props, events, and methods.
Anatomy
menu item (<button>)
item (<div>)
item (Snippet)
container (<div>)
checkmark (<div>)
content (<div>)
shortcut (<div>)
chevron (<div>)
popover (<Popover>)
menu (<Menu>)
children (Snippet)