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.
readonlybooleanfalsePrevents opening the panel.
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 → "", multi → []).
clearButtonAriaLabelstring""Clear button label; defaults to bundled dropdown.clear.
selectAllLabelstring""Select-all row label; defaults to bundled dropdown.selectAll.
selectedCountLabelstring""Count mode template; {count} placeholder.
maxVisibleChipsnumber—Chips mode overflow before “show more”.

Advanced ​

PropTypeDefaultDescription
ariaLabelstring""Trigger aria-label when no visible label.
ariaDescribedbystring""Extra id values merged into aria-describedby alongside generated supporting-text ids.
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.

  • Include a focusable control (e.g. <button type="button">) with appropriate role="combobox", aria-expanded, aria-controls, and aria-activedescendant (or equivalent labelling).
  • 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).
open-changebooleanOpen state changed (true / false). Use @open-change.
update:filterValuestringFilter text (filterable).
close—Panel dismissed.

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