Skip to content

Dropdown ​

An action menu, not a form select. The menu reuses the Select listbox wash: white surface, 1px border, --gk-radius-sm (6px), and a 22% brand wash on hover. Danger rows use danger text and a soft danger wash. z-index is 4000.

Demos ​

Text and chevron

The built-in trigger is label plus a chevron. variant="primary" is the brand fill from the approved mock; the default variant is the outlined size scale below. Choosing an item emits select with { key, item } and closes the menu.
EditCopy linkArchive (unavailable)Delete

Last key: (none)

Danger and divider

type="divider" is a separator. danger paints the row in the danger color.
EditCopy linkDelete

Shortcuts

shortcut is a muted hint on the right. It does not register a real keyboard shortcut.
EditCopy linkDelete

Disabled item

A disabled item is muted and cannot be selected. Arrow keys skip it.
EditArchive (unavailable)Download

Placement

Default placement is bottom-start. The menu flips when it would leave the viewport, same helper as Tooltip.
ViewRename

Trigger sizes

Without a trigger slot, the outlined button shows label plus a chevron. Heights follow size: 28 / 34 / 40. Default size is md.
ViewRenameViewView

Icon / quaternary trigger

Slot any trigger, including gk-button quaternary. The menu chrome stays the same. quaternary was added to Button for this quiet icon trigger; Button previously had text, dashed, and secondary only.
⋯EditCopy linkDelete

Alpine ​

html
<div x-data="{ key: '' }">
  <gk-dropdown label="More" x-on:select="key = $event.detail.key">
    <gk-dropdown-item key="edit">Edit</gk-dropdown-item>
    <gk-dropdown-item key="copy">Copy</gk-dropdown-item>
  </gk-dropdown>
  <span x-text="key"></span>
</div>

API ​

PropTypeDefault
labelstring''
placementplacement string'bottom-start'
trigger'click' | 'hover' | 'manual''click'
disabledbooleanfalse
size'sm' | 'md' | 'lg''md'
variant'default' | 'primary''default'
openbooleanfalse
PropTypeDefault
keystring''
labelstring''
shortcutstring''
type'item' | 'divider''item'
disabledbooleanfalse
dangerbooleanfalse

Slots ​

NameDescription
triggerCustom trigger. Falls back to a text + chevron button
defaultgk-dropdown-item children

Events ​

NameDetail
select{ key, item }
update:openNext boolean
open / closeFired when the menu opens or closes

Keyboard ​

Arrow Up/Down move the active item, Home/End jump, Enter selects, Escape closes. Outside clicks close. The trigger exposes aria-haspopup="menu" and aria-expanded. Items are menuitem; dividers are separator.

CSS parts ​

gk-dropdown: trigger, menu. gk-dropdown-item: item, label, shortcut, divider.

Menu radius uses --gk-radius-sm (0.375rem, 6px), the same token as the Select listbox. The spec also wrote --gk-radius-md next to “6px”; that token is 0.5rem, so the approved 6px mock and the Select wash win.