Skip to content

List ​

Scrollable list panel for pickers, menus, and custom overlays. Compose rows with catnip-list-item; optional catnip-divider between rows for visual grouping.

Overview ​

catnip-list is a presentational primitive: it does not own selection state or an items prop. The parent loops catnip-list-item children (or places them statically), binds selected, active, disabled, and intent, and handles click on each row.

Set selection-appearance once on the list so every row uses the same selection chrome (default stroke, checkmark, or checkbox).

PieceRole
catnip-listPanel chrome, scrollable body, header / footer slots
catnip-list-itemOne interactive row (left, default, right slots). Labels wrap; unbreakable strings break instead of stretching the panel.
catnip-dividerOptional visual separator between direct children of the list

catnip-dropdown still uses an internal list implementation for its option panel; you do not need catnip-list inside a dropdown unless you are building a custom overlay.

Live example ​

Guidelines ​

When to use ​

PatternUse
catnip-list + catnip-list-itemCustom overlays, standalone pickers, or menus where you own layout and state
catnip-dropdownLabelled field with trigger, filter, and value binding
Internal list (Vue only)Inside Catnip package development; prefer public CEs in apps

Composition rules ​

  1. Place catnip-list-item (and optional catnip-divider) as direct children of catnip-list. Use slot="header" / slot="footer" only on non-row content.
  2. Set selection-appearance on the list once; bind selected per row.
  3. Parent owns the loop (v-for or static markup), click handlers, and any filter logic in header.

Selection appearance ​

ValueUse
defaultSingle-select with side stroke + primary fill
checkmarkSingle-select with a tick on the right
checkboxMulti-select; checkbox on the left of every row

State styling ​

  • Unselected rows have a transparent background. Neutral rows use the neutral hover surface; danger rows use the danger subtle hover surface.
  • Disabled rows use the disabled foreground colour and no background. Selected default and checkmark rows retain their disabled selection fill.
  • Selected default and checkmark danger rows retain their danger selection fill; checkbox rows remain transparent until hover.
  • Disabled styling takes precedence when disabled and intent="danger" are combined.

Dividers ​

Insert catnip-divider between items for visual groups (for example destructive actions):

html
<catnip-list list-role="menu" list-aria-label="Actions">
  <catnip-list-item>Rename</catnip-list-item>
  <catnip-divider size="s"></catnip-divider>
  <catnip-list-item intent="danger">Delete</catnip-list-item>
</catnip-list>

Keep dividers decorative (default) inside listbox/menu panels; see Accessibility for how parent keyboard logic treats them.

Vue binding ​

vue
<catnip-list selection-appearance="checkmark" list-role="listbox" list-aria-label="Services" .maxHeight="280">
  <catnip-list-item
    v-for="item in items"
    :key="item.value"
    :list-item-id="'opt-' + item.value"
    .selected="selected === item.value"
    .active="active === item.value"
    @click="onSelect(item.value)"
  >
    {{ item.label }}
  </catnip-list-item>
</catnip-list>

Use leading-dot props for booleans and objects. Listen for @click and read event.detail[0].

Catnip Design System by Signicat