Skip to content

Dropdown ​

Use one API per dropdown. Switch the API control (top right) to read docs for that API only. If options is set, any <catnip-dropdown-option> children are ignored.



catnip-dropdown ​

Props ​

Value & selection ​

Field presentation ​

PropTypeDefaultDescription
labelstring""Visible field label when the label slot is empty.
optionalbooleanfalseWhen true and not required, shows the localized optional hint.
optionalTextstring""Overrides the localized optional hint (HTML: optional-text).
infostring""Info tooltip beside the label; when non-empty, it wins over the label.suffix slot.
alignment"left" | "center" | "right""left"Horizontal alignment of the field label block.
requiredMarkerstring"*"Visual marker for required fields (HTML: required-marker).
requiredScreenReaderTextstring""Optional screen-reader supplement; it does not replace required on the control (HTML: required-screen-reader-text).
size"s" | "m" | "l""m"s, m, l — trigger and field density.
intent"neutral" | "danger" | "warning" | "success""neutral"Semantic state applied to field and supporting-text styling; danger sets aria-invalid on the trigger.
disabledbooleanfalseDisables the field.
readonlybooleanfalseShows the value without letting it change. The combobox stays in the Tab order with aria-readonly and doesn't open.
hideLabelbooleanfalseHides the built-in label row.
supportingTextSupportingTextProp""One or more helper or validation messages. Each object requires text; intent accepts neutral, danger, warning, or success, and icon accepts a Catnip icon name. See supporting-text examples.

Panel & filter ​

PropTypeDefaultDescription
openboolean | nullnullControlled open state. null = uncontrolled. Pair with open-change.
listMaxHeightstring | number280pxScrollable list body max height.
listMaxWidthstring | number320pxOpen list max width. Empty string removes the cap. Never narrower than the trigger.
filterablebooleanfalseBuilt-in search row in list header (label filter).
filterLocallybooleantrueWhen false, skip built-in label filtering (parent owns visible rows).
filterPlaceholderstring""Placeholder for built-in search.
filterValuestring""Controlled filter text.
catnipInputCatnipInputControlProps{}Props forwarded to built-in filter catnip-input.
showClearButtonbooleanfalseClears selection (single → null, multi → []) and emits clear.
clearButtonAriaLabelstring""Clear button label; defaults to bundled dropdown.clear.
selectAllLabelstring""Select-all checkbox label; defaults to bundled dropdown.selectAll.
selectedCountLabelstring""Count mode template; {count} placeholder.
maxVisibleChipsnumber—Chips mode overflow before “show more”.

Advanced ​

PropTypeDefaultDescription
dropdownAriaLabelstring""Trigger aria-label when no visible label.
ariaDescribedbystring""IDs of elements in the page, or in the shadow root the element sits in, that describe the field. They're resolved there and connected to the inner control by element reflection, read before the supporting text.
testSelectorsTestSelectorsPropSee belowOverrides stable data-test values.

Derived behaviour: single-select uses checkmark rows; multi-select uses checkbox rows. Chevron flips when open.

Slots ​

SlotDescription
label, label.action, label.suffixField label row
triggerFull trigger override — see Trigger slot below
valueSelected value area inside default trigger
leftIconSlot, rightIconSlotTrigger adornments
listHeaderPanel header — wins over filterable
listFooterPanel footer (e.g. Add new)
catnipInput.leftIconSlot, catnipInput.rightIconSlotForwarded to built-in filter input

Trigger slot ​

When trigger is set, the default combobox shell is replaced. The slot is wrapped in an anchor element used to position the floating panel.

  • What the slotted control needs for accessibility is on the Accessibility tab.
  • Open/close and keyboard behaviour are still driven by the dropdown; wire @click / @keydown on your control if you replace the default trigger entirely.
  • A dev warning is logged if no focusable element is found inside the slot.

Events ​

EventPayloadDescription
update:modelValuescalar or arraySelection changed (string, number, or boolean). Clearing emits null (single) or [] (multiple).
open-changebooleanOpen state changed (true / false). Not emitted when the state doesn't change. Use @open-change.
update:filterValuestringFilter text (filterable).
close—The panel closed, for any reason: a pick, Escape, a press outside, Tab, or focus moving elsewhere.
clear—Clear button pressed. Fires after update:modelValue; handle it to reset to your own default (e.g. 0).

Test selectors ​

KeyDefault
rootcatnip-dropdown
triggercatnip-dropdown-trigger
valuecatnip-dropdown-value
chevroncatnip-dropdown-chevron
clearButtoncatnip-dropdown-clear
supportingTextcatnip-dropdown-supporting-text

Nested: floatingPanel, list, filterInput (same keys as embedded components).



Examples ​

Catnip Design System by Signicat