Skip to content

Toggle Group ​

A toggle group is a segmented control for choosing exactly one value from a short list of mutually exclusive options.

Overview ​

Pass options (array of { value, label?, icon?, disabled? }) and bind modelValue as a single selected value. Set an option's icon to render a decorative Catnip icon before its visible label.

catnip-toggle-group also provides:

  • Field label (prop or label slot), required / optional markers, info tooltip
  • supporting-text below the group (validation, hints)
  • appearance — default (white selected pill) or accent (brand selected pill)
  • size — m or l segment and label sizing
  • role="radiogroup" with aria-labelledby / aria-describedby wiring

Use catnip-radio-group when each option needs a full radio row with supporting text. Use catnip-tabs for navigation between views or panels.

Live example ​

Guidelines ​

When to use ​

PatternUse
catnip-toggle-groupCompact single-select from 2–5 short labels (Figma Toggle group).
catnip-radio-groupLabelled single-select when each option needs supporting text or a full radio row.
catnip-tabsNavigation between views, panels, or routes.
catnip-toggleA single on/off setting.

Binding ​

vue
<catnip-toggle-group
  label="View"
  appearance="accent"
  size="l"
  .options="options"
  .modelValue="selected"
  @update:modelValue="selected = $event.detail[0] ?? $event.detail"
/>
js
const selected = ref("day");

const options = [
  { value: "day", label: "Day", icon: "clock" },
  { value: "week", label: "Week", icon: "calendar" },
  { value: "month", label: "Month", icon: "calendar-changes" }
];

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

Use the optional icon field when it helps users distinguish short choices. Each icon-bearing option still needs a text label; see What you own.

Variants ​

VariantSelected style
defaultWhite pill with bold dark text — use on neutral surfaces.
accentBrand purple pill with white text — use when the selection should draw more attention.

Catnip Design System by Signicat