sheengemologic ui
All components

SegmentedControl

A compact single-selection control with native radio submission and bounded overflow.@gemologic/sheen · forms

Playground

Report period
<SegmentedControl label="Report period" name="period" options={[{ value: "day", label: "Day" }, { value: "week", label: "Week" }, { value: "month", label: "Month" }]} defaultValue="week"  orientation="horizontal" overflowBehavior="scroll" size="sm"/>

Variant matrix

Report period
Report period
orientation: horizontal
Report period
orientation: vertical
Report period
size: sm
Report period
size: md
Report period
overflowBehavior: scroll
Report period
overflowBehavior: wrap
Report period

Anatomy

Package
@gemologic/sheen
Source
packages/ui/src/primitives/SegmentedControl.tsx
Tokens
  • --sheen-color-bg-inset
  • --sheen-color-bg-hover
  • --sheen-color-accent-subtle
  • --sheen-color-accent-fg
  • --sheen-color-focus-ring

Accessibility

Role: radiogroup and native radioKeyboard: Tab, Shift+Tab, Arrow keys, Home, End, Space

Do

  • Use for a short set of mutually exclusive peer views or modes.

Do not

  • Do not use segments for independent toggles or a long searchable taxonomy.

Generated props

NameTypeDefaultDescription
idstringRoot fieldset ID used to derive stable relationships.
refHTMLFieldSetElement | ((element: HTMLFieldSetElement) => void)Native root fieldset reference.
name *stringRequired nonempty native radio-group name.
label *stringRequired visible group legend.
options *readonly SegmentedControlOption[]Ordered unique values with nonempty labels and optional disabled state.
valuestring | nullApp-owned selection, or null for no selection.
defaultValuestring | nullCaptured uncontrolled selection restored on uncanceled form reset.
onValueChange(value: string | null) => voidReceives requested committed selection changes.
descriptionstringSupporting instructions associated with the group.
errorstringAssociated error and invalid state.
readOnlybooleanfalseKeeps the group focusable and submitted while rejecting changes.
requiredbooleanfalseRequires one enabled selection for native validation.
orientation"horizontal" | "vertical"horizontalVisual and keyboard orientation.
size"sm" | "md"smCompact or standard segment height.
overflowBehavior"scroll" | "wrap"scrollScrolls one line by default or wraps when the app permits height growth.
Native Solid/HTML attributes remain available and are omitted from this authored-prop view.