MenuButton
A button that opens and closes a menu.
Code
<script lang="ts">
import { MenuButton } from '@geoffcox/sterling-svelte';
</script>
<MenuButton>
<!-- button content -->
{#snippet items()}
<!-- <MenuItem> ... -->
{/snippet}
</MenuButton>
Members
| Property Name | Type | Default | Comment |
---|
| items | Snippet | undefined | undefined |
| menuClass | string | '' |
| open | boolean | false |
| onClose | (value: string) => void | |
| onOpen | (value: string) => void | |
| onSelect | (value: string) => void | |
| popoverPlacement | PopoverPlacement | bottom-start |
| value | string | undefined |
Considerations
- Includes Button props, events, and methods.
- Includes HTMLButtonElement props, events, and methods.
Anatomy
button (<Button>)
reference (<div>)
children (Snippet)
popover (<Popover>)
menu (<Menu>)
items (Snippet)