Primitives

Segmented

Pill, solid, outline, glass; three sizes; the thumb slides. Two or three options — beyond three it becomes a Select.

Import#

Everything comes from the package root. The example above uses:

your-component.tsx
import { Segmented } from "@waveinno/ui";

Props#

Read from the source of this version, so they match the code exactly.

<Segmented>

src/components/ui/segmented.tsx
PropTypeDefaultDescription
valuerequiredT—
onChangerequired(v: T) => void—
optionsrequiredSegmentedOption<T>[]—
classNamestring—
ariaLabelstring—
variantkeyof typeof TRACK"pill"
sizekeyof typeof SIZES"sm"
fullWidthbooleanfalseStretch to the container, options sharing the width equally.

Install#

If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.

$ npm install @waveinno/ui