logo-icon
STW UI

Dropdown

Dropdown can open a menu or any other element when the button is clicked.

Usage

svelte
import { Dropdown } from 'stwui';
// OR
import Dropdown from 'stwui/dropdown'; // for tree shaking

With Placement

With Alignment

Avatar Dropdown

Dropdown Props

visible boolean false

Dropdown Slots

trigger
items <Dropdown.Items slot="items" />

Dropdown.Items Props

placement 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end' | 'bottom' | 'bottom-start' | 'bottom-end' bottom-start
offset number 8

Dropdown.Items Slots

default <Dropdown.Items.Item />

Dropdown.Items.Item Props

label string

Dropdown.Items.Item Slots

icon <Dropdown.Items.Item.Icon slot="icon" />
extra

Dropdown.Items.Item.Icon Props

data string (IconData)
viewBox string 0 0 24 24
size string 24px
width string 24px
height string 24px
color string currentColor
stroke string | undefined
fill string currentColor

Dropdown Class Identifiers

stwui-dropdown
stwui-dropdown-items
stwui-dropdown-item
stwui-dropdown-divider