Skip to content

Checklist ​

A checklist is a field control for choosing multiple values from a short list of options on the page — matching Figma checkbox Examples (group label + several checkbox inputs + validation copy).

Overview ​

Pass options (array of { value, label?, … }) and bind modelValue as an array of selected **value**s — same idea as catnip-dropdown with multiple.

catnip-checklist also provides:

  • Field label (prop or label slot), required / optional markers, info tooltip
  • supporting-text below the group (validation, hints)
  • role="group" with aria-labelledby / aria-describedby wiring

Use a single catnip-checkbox when you only need one option. Use catnip-dropdown multiple for long lists in a compact panel.

Per-option errors ​

Set intent and supportingText on each options row for row-level validation. Set intent and supporting-text on the checklist for group-level copy. The live example shows Option B in danger with supporting text when it conflicts with Option A.

See Guidelines — Validation for a dynamic pattern.

Live example ​

Guidelines ​

When to use ​

PatternUse
catnip-checklistLabelled multi-select from an options array (Figma checkbox Examples).
catnip-checkbox aloneSingle option, consent, or a row you place yourself outside a checklist.
catnip-dropdown multipleMany options in a compact panel; checkbox chrome is internal.

Do not nest catnip-checkbox inside catnip-dropdown options — see Checkbox — Dropdown lists.

Binding ​

vue
<catnip-checklist
  label="Choose multiple"
  required
  intent="danger"
  supporting-text="Resolve the option-level errors below."
  .options="options"
  .modelValue="selected"
  @update:modelValue="selected = $event.detail[0] ?? $event.detail"
/>
js
const selected = ref(["a", "b"]);

const options = ref([
  { value: "a", label: "Option A" },
  {
    value: "b",
    label: "Option B",
    intent: "danger",
    supportingText: "Cannot be selected together with Option A."
  },
  { value: "c", label: "Option C" }
]);

Bind .options and .modelValue on the host (see Component API). Toggling updates modelValue on the checklist host.

Validation (group + per option) ​

Use two levels:

LevelSet onExample
Groupcatnip-checklist → intent, supporting-text“Select at least one option.”
RowEach options[] item → intent, supportingText“Cannot be selected with Option A.”

Per-row intent is only neutral or danger (same as catnip-checkbox). Group intent also supports warning and success for the field supporting-text block.

A disabled checklist or disabled option always uses disabled checkbox styling, even when that option also has intent="danger".

Static row errors ​

Put intent and supportingText directly on the option object (see live playground — Option B shows a row error while A and B are selected).

Dynamic row errors (your app updates options) ​

Recompute the options array when selection or server validation changes:

js
import { computed, ref } from "vue";

const selected = ref([]);

const baseOptions = [
  { value: "a", label: "Option A" },
  { value: "b", label: "Option B" },
  { value: "c", label: "Option C" }
];

const conflict = computed(() => selected.value.includes("a") && selected.value.includes("b"));

const options = computed(() =>
  baseOptions.map((opt) => {
    if (opt.value !== "b") return opt;
    if (!conflict.value) return opt;
    return {
      ...opt,
      intent: "danger",
      supportingText: "Cannot be selected together with Option A."
    };
  })
);

const groupSupportingText = computed(() => (conflict.value ? "Resolve the option-level errors below." : ""));

const groupIntent = computed(() => (conflict.value ? "danger" : "neutral"));
vue
<catnip-checklist
  label="Choose multiple"
  .intent="groupIntent"
  .supportingText="groupSupportingText"
  .options="options"
  .modelValue="selected"
  @update:modelValue="selected = $event.detail[0] ?? $event.detail"
/>

supportingText on an option accepts a string, string[], { text, intent?, icon? }, or an array of those objects. See supporting-text examples.

Catnip Design System by Signicat