Overview Button Copy button Field Input Number field Textarea Select Combobox Multiselect Date picker Date range picker Date-time picker Checkbox Radio group Position picker Switch Slider Dropzone Device controls Avatar Badge Card Collapsible Kbd Map Matrix Proportion bar Separator Stat Table Timeline Chat Playback Pagination Charts Chart theming Profile chart Time series chart Bar chart Isopleth chart TS diagram Box plot Rose chart Calendar chart Banner Toast Loader Progress Skeleton Empty state Error state Dropdown menu Tooltip Info tooltip Dialog Sheet Resizable Confirm dialog Breadcrumbs Command palette Mobile menu Navigation list Outline Scroll rail Sidebar Tabs
Dropdown menu
Actions and options behind a button, on the Select list's surface. Arrow keys move, typing jumps to an item, Escape closes.
Actions
The menu on a row's more button.
5. mars
Starefoss ledning
<DropdownMenu>
<DropdownMenuTrigger>
{#snippet child({ props })}
<Button {...props} variant="ghost" size="sm" square iconLeft="ellipsis-vertical" aria-label="More" />
{/snippet}
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem icon="pen" onSelect={edit}>Edit</DropdownMenuItem>
<DropdownMenuItem icon="copy" shortcut="⌘D" onSelect={duplicate}>Duplicate</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem icon="trash" variant="danger" onSelect={remove}>Delete</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu> Options
Checkbox and radio items set view options. The menu stays open while you set them.
Rules
- More actions open from the vertical ellipsis, a ghost icon button with the tooltip "More". On a row, align the menu to the end.
- Items are verbs, like the buttons they replace. Most used first.
- Delete and other things that can’t be undone go last, after a separator, in danger, and open a confirm dialog.
- Icons on all items or on none. A shortcut only if it works.
- Options that filter or sort keep the menu open, so several can be set in one go.
- One level of submenu at most. Deeper belongs in a dialog.