Interfacestable
Detent
Segmented control
A segmented control built on native radios, with a thumb that slides to the selection.
Customize
Layoutequal segments, native radios
variantfullWidthdisabledUsage
import { Detent } from "zerogravity/detent"
<Detent
label="View"
options={[
{ value: "grid", label: "Grid" },
{ value: "list", label: "List" },
{ value: "board", label: "Board" },
]}
/>Generated from the controls above. Only props that differ from their defaults are shown.
Props
| Property | Type | Default | Description |
|---|---|---|---|
variant | "pixel" | "classic" | "minimal" | "glass" | "pixel" | Style. |
fullWidth | boolean | false | Full width. |
disabled | boolean | false | Disabled. |
options | { value: string | number; label: ReactNode; disabled?: boolean }[] | — | The segments, in order. |
label | string | — | Accessible name of the group. |
value | string | number | — | Controlled selection. |
defaultValue | string | number | first enabled option | Uncontrolled starting selection. |
onChange | (value) => void | — | Receives the selected option's own value. |
name | string | generated | Form field name. |
Dependencies
0 external runtime dependencies
Ships with nothing but React.