Components › Actions

Segmented control

One choice from a short set. A raised pill slides to the chosen option.

Installation

npx plankui@latest add segmented

Usage

import { Segmented } from "@/components/ui/segmented";

<Segmented options={[{ value: "monthly", label: "Monthly" }, { value: "yearly", label: "Yearly" }]} />

API reference

PropTypeDefaultDescription
options{ value: string; label: ReactNode; disabled?: boolean }[]requiredThe choices.
value / defaultValuestringfirst optionControlled or initial value.
onValueChange(value: string) => voidCalled when the choice changes.
size"sm" | "md""md"Key height.

View the source on GitHub