1. Kikita UI
  2. Components
  3. Surfaces
  4. Dropdown
  5. Playground
Skip to content
Kikita UI
  • Installation
  • Theming
  • Tokens
  • Typography
  • Density
  • Accessibility
  • Migrating to 2.0
  • Internationalization
  • Defaults
  • Structural icons
  • Auto Focus
  • Forms
  • AI Support
  • Package Smoke
  • Button
  • Link
  • Icon Button
  • Menu
  • Command Palette
  • Field
  • Input
  • Color Input
  • Select
  • Combobox
  • Date Picker
  • Time Picker
  • Calendar
  • Calendar Range
  • File Upload
  • Segmented
  • Slider
  • Number Input
  • OTP Input
  • Textarea
  • Checkbox
  • Switch
  • Radio
  • Group
  • Badge
  • Loader
  • Skeleton
  • Tooltip
  • Toast
  • Empty State
  • Alert
  • Progress
  • Card
  • Tabs
  • Accordion
  • Breadcrumbs
  • Popover
  • Dialog
  • Media Viewer
  • Drawer
  • Splitter
  • Dropdown
  • Separator
  • Stepper
  • Icon
  • Avatar
  • Table
  • Pagination
  • Line Chart
  • Bar Chart
  • Scatter Chart
  • Donut Chart
  • Carousel
  • Chip
  • Scrollbar
  • Tree

Dropdown — Playground

px
panelRole
panelWidth
State
html.html
<button type="button" [kuiDropdownFor]="menu">Actions</button>

<kui-dropdown #menu>
  <div kuiOption value="edit">Edit</div>
  <div kuiOption value="duplicate">Duplicate</div>
  <div kuiOption value="archive">Archive</div>
</kui-dropdown>
NameTypeDefaultDescription
maxHeightstring | null | undefined'240px' (--kui-dropdown-max-height)Preferred max height of the panel before it scrolls. Falls back to defaults.dropdown.maxHeight, then the --kui-dropdown-max-height token (240px). Always additionally clamped to the viewport so the panel can never render taller than the screen. null removes only the preferred cap, not the viewport clamp.
offsetnumber | undefined4Gap in px between the anchor and the panel edge. A static numeric attribute is coerced. Falls back to defaults.dropdown.offset.
closeOnSelectboolean | undefinedtrueCloses the panel after an enabled option is selected with a pointer or Enter/Space. A plain input (it is no longer a two-way model). Falls back to defaults.dropdown.closeOnSelect.
openModelSignal<boolean>falseControlled open state. Bind with [(open)] to keep parent state synchronized with Escape, outside-click, and off-screen-anchor dismissal. Imperative open(), close(), and toggle() remain available.
panelRole'listbox' | 'dialog' | 'grid' | null'listbox'ARIA role rendered on the panel. Set to dialog (or null to omit the role) for non-listbox projected content, e.g. kui-calendar.
panelWidth'anchor' | 'content' | 'auto' | undefined'anchor'Falls back to defaults.dropdown.panelWidth. anchor matches the trigger's width exactly (listboxes). content grows with the panel's own content but never below the trigger's width. auto ignores the trigger's width and sizes purely to content.
widthstring | nullnullExplicit panel width (any CSS width, e.g. 320px). Overrides panelWidth entirely when set.
isOpenSignal<boolean>-Current open state.
open()method-Shows the panel and attaches scroll/outside-click/Escape listeners.
close()method-Starts the close animation and detaches listeners.
toggle()method-Opens when closed, closes when open.
setAnchor(el, focusReturn?)method-Sets the anchor imperatively. The optional third argument names the element that receives focus when the panel closes after a selection or Escape. Called by kui-field and [kuiDropdownFor].
getPanel()method-Returns the rendered panel element, if attached.
getPanelId()method-Returns the stable panel id for ARIA wiring.
[kuiDropdownFor]KuiDropdown-Wires a standalone trigger to a dropdown instance and manages click toggling, aria-expanded, and aria-haspopup. Prefer a native button so keyboard behavior is already correct.
[kuiOption] valueunknown-Required. The value an option renders and emits. Set via the `value` input on `KuiOption`, e.g. `<div kuiOption value="edit">`.
[kuiOption] disabledbooleanfalseDisables click and keyboard selection for this option.
kuiOptionSelectEventEmitter<unknown>-Emits the option value on selection.
--kui-dropdown-bgCSS custom propertyvar(--kui-color-surface-elevated)Panel background.
--kui-dropdown-borderCSS custom propertyvar(--kui-color-border)Panel border color.
--kui-dropdown-radiusCSS custom propertyvar(--kui-radius-md)Panel corner radius.
--kui-dropdown-shadowCSS custom propertyvar(--kui-shadow-lg)Panel drop shadow.
--kui-dropdown-viewport-marginCSS custom propertyvar(--kui-space-6, 32px)Margin subtracted from the viewport height when clamping the panel max-height.
Known non-feature--Dropdown does not own selection or value state itself. Select, Combobox, Menu, or another host component provides that context; a bare kui-dropdown only positions the panel and manages open/close.
KuiDropdownOptionsinterface-Shape of defaults.dropdown: maxHeight, offset, closeOnSelect and panelWidth.

API verified against @kikita-labs/ui v2.0.0 public typings.