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

Same label row props as Input (label, info, optional, alignment, …) and supportingText.

PropTypeDefaultDescription
sizestring"m"s, m, l — trigger and field density.
intentstring"neutral"neutral, warning, danger, success.
disabledbooleanfalseDisables the field.
readonlybooleanfalsePrevents opening the panel.
hideLabelbooleanfalseHides the built-in label row.

Panel & filter

PropTypeDefaultDescription
openbooleanControlled open state (optional).
listMaxHeightstring | number280pxScrollable list body max height.
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.
catnipInputobject{}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.
maxVisibleChipsnumberChips mode overflow before “show more”.

Advanced

PropTypeDefaultDescription
ariaLabelstring""Trigger aria-label when no visible label.
ariaDescribedbystring""Extra describedby ids (supporting text id added automatically).
testSelectorsobjectSee belowdata-test overrides.

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
list-headerPanel header — wins over filterable
list-footerPanel 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).
update:openbooleanOpen state (controlled open).
update:filterValuestringFilter text (filterable).
closePanel 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