MenuButton
A <Button> that opens/closes a <Menu>
Code
<script lang="ts">
import { MenuButton } from '@geoffcox/sterling-svelte';
</script>
<MenuButton>
<!-- <MenuItem> ... -->
</MenuButton>
Members
| Property Name | Type | Default | Comment | | open | string | false |
| menuVariant | string | '' |
| value | string | '' |
| variant | string | '' |
| Event Name | Data | Comment | | close | { value: string } |
| open | { value: string } |
| selected | { value: string } |
Considerations
- Includes Button props, event, and methods
- Includes HTMLButtonElement props, event, and methods
Anatomy
<Button>
<div class="reference">
<slot {open} {value} {variant} />
</div>
<Popover>
<Menu variant={menuVariant}>
<slot name="items" />
</Menu>
</Popover>
</Button>