Dropdown
A value and associated button to open/close a floating content box.
Code
<script lang="ts">
import { Dropdown } from '@geoffcox/sterling-svelte';
</script>
<Dropdown bind:open>
{#snippet value()}
<!-- TODO: value display -->
{/snippet}
{#snippet content()}
<!-- TODO: dropdown content -->
{/snippet}
</Dropdown>
Members
| Property Name | Type | Default | Comment |
---|
| button | string | Snippet | undefined | undefined |
| buttonIcon | string | Snippet | undefined | undefined |
| disabled | boolean | null | undefined | false |
| onOpen | (open: boolean | null | undefined) => void | undefined |
| open | boolean | null | undefined | false |
| stayOpenOnClickAway | boolean | null | undefined | false |
| value | string | Snippet | undefined | undefined |
Considerations
- Includes HTMLDivElement props, events, and methods.
Anatomy
dropdown (<div>)
value container (<div>)
value (<string | Snippet>)
button (<Snippet>)
button container <div>
buttonIcon <Snippet>
chevron (<div>)
dropdown content (<Popover>)
content (<div>)
children (<Snippet>)