Button group

Button group is a neobrutalist React component from Cruise UI. A row of joined buttons for switching between 2–5 views or filters. Install it with npx shadcn@latest add @cruiseui/toggle-button-group.

Install

Terminal

npx shadcn@latest add @cruiseui/toggle-button-group

First time? Installation shows the one-off components.json setup (the @cruiseui registry) and how to turn the theme on.

Example

Corners

When to use it

When to use

Switching between views or filters that apply straight away (Day / Week / Month).

When not to

More than 5 options (use a Select or Tabs). Actions that aren't a choice (use separate Buttons).

Props

CruiseToggleButtonGroup

PropTypeDefaultDescription
labelstring—Accessible name for the group, e.g. "View".
optionsCruiseToggleOption<V>[]——
valueV——
onChange(value: V) => void——
className?string——

Accessibility

  • role="group" with an aria-label; every button has aria-pressed.
  • Arrow keys move between the buttons.
  • One shadow on the group; it scrolls sideways on small screens instead of overflowing.