rokle

Personality

20
40
70
15

Active brand: Meridian

Adjust sliders to see every component on the page respond in real time.

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/tokens

Installs 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

PropTypeDefaultDescription
items{ label: string; value: string }[]-Segment options.
valuestring-Currently selected segment value.
onValueChange(value: string) => void-Called when selection changes.