SegmentGroup
Segmented control for selecting one option from a small set, visually similar to a button group.
Examples
Basic
A segmented control for mutually exclusive choices.
With Icons
Segments with icon characters.
Sizes
Segment groups at different widths.
Disabled Item
One segment disabled within an otherwise interactive group.
Installation
pnpm add @rokle/components @rokle/tokensInstalls with the default Rokle brand. Generate a custom brand on rokle.app to use your own colours and personality.
Usage
import { SegmentGroup } from "@rokle/components";import { SegmentGroup } from "@rokle/components";
export function Example() {
return <SegmentGroup />;
}API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| items | { label: string; value: string }[] | - | Segment options. |
| value | string | - | Currently selected segment value. |
| onValueChange | (value: string) => void | - | Called when selection changes. |