Skip to content

Design system

Documentation

DesignComponents / Segmented

Components / Segmented

Stable

Segmented

Switch between a small set of related views using RadioGroup keyboard behavior.

On this page

Examples

Switch a view

Use a short set of mutually exclusive view options.

ListGridMap

Project view selection

Controlled choice

Keep the active time period in feature state.

WeekMonthQuarter

Controlled reporting period

Vertical options

Use vertical orientation for narrow side panels.

OverviewActivitySettings

Vertical workspace section

Try the segments

Inspect a compact time-scale selector.

DayWeekMonth

Segmented property playground

Usage

import { Segmented } from "@phuctech/ui/components/segmented";

<Segmented label="Project view" options={views} defaultValue="list" />

Provide a short group of mutually exclusive options. If options need search, descriptions, or long text, use RadioGroup or Select.

API

Component API
PropTypeDefaultDescriptionConstraints
labelstringrequiredAccessible name for the choice group.Keep it specific to the selected view or mode.
optionsreadonly { value: string; label: ReactNode; disabled?: boolean }[]requiredMutually exclusive choices.Use stable, unique values and short labels.
value / defaultValuestringunselectedControlled value or initial choice.The value must match one option.
onValueChange(value: string) => void—Called when a choice changes.The feature owns data and navigation behavior.
orientationhorizontal | verticalhorizontalControls layout and arrow-key direction.Horizontal controls scroll when labels exceed their container.
disabled / readOnlybooleanfalseForwards shared RadioGroup state behavior.An individual option may also be disabled.

Accessibility

Segmented uses radio roles and roving focus. Arrow keys follow the selected orientation, and each option label supplies its accessible name. Do not communicate the selected view through color alone.

  • RadioGroup supports richer choice layouts.
  • Tabs switches between labeled content panels.