compacto-ui

Search documentation

Jump to a page or a component.

OptionList

Full-width selectable rows — icon, label, description, check.

Preview

Installation

No install — ask an AI agent to copy this component from registry.json.

import { OptionList } from "@/components/ui/option-list";

Notes

  • A divide-y segmented group inside one outer border — reach for OptionGrid instead when a swatch preview matters more than a description.
  • Controlled only — value and onValueChange are both required.
  • Derives ${testId}-<value> per row from data-testid.

Props

The props worth knowing. Everything else passes straight through to the underlying element, including className, which is merged last so it always wins.

PropTypeDefaultDescription
options{ value, label, description?, icon? }[]—The choices, in order.
valuestring—The selected option's value.
onValueChange(value: string) => void—Called with a value when its row is clicked.