EXEPERTAI LAB

Research alpha

Time Machine
EXEPERTAI LAB
GALLERY / COLLECTION
← Browse Astryx gallery
SegmentedControl·component·@astryxdesign/core

Segmented Control Item

Individual segment item rendering as a radio button within the segmented control.

Open in Playground @astryxdesign/core/SegmentedControl

Showcases and examples

2 documented examples

Segmented Control Item

Segmented control items with text labels and icons, including a disabled item.

Preview loads on approachPreview loads on approach
Exact source · segmented-control-item-showcase
// Copyright (c) Meta Platforms, Inc. and affiliates.

'use client';

import {useState} from 'react';
import {
  SegmentedControl,
  SegmentedControlItem,
} from '@astryxdesign/core/SegmentedControl';
import {Center} from '@astryxdesign/core/Center';
import {Icon} from '@astryxdesign/core/Icon';

export default function SegmentedControlItemShowcase() {
  const [view, setView] = useState('board');

  return (
    <Center>
      <SegmentedControl value={view} onChange={setView} label="View mode">
        <SegmentedControlItem
          value="board"
          label="Board"
          icon={<Icon icon="viewColumns" />}
        />
        <SegmentedControlItem
          value="list"
          label="List"
          icon={<Icon icon="menu" />}
        />
        <SegmentedControlItem
          value="timeline"
          label="Timeline"
          icon={<Icon icon="calendar" />}
        />
        <SegmentedControlItem
          value="chart"
          label="Chart"
          icon={<Icon icon="arrowsUpDown" />}
          isDisabled
        />
      </SegmentedControl>
    </Center>
  );
}

Usage

Individual segment item rendering as a radio button within the segmented control.

Typed props

PropType and behavior
valuestring · required
Unique value for this segment, matched against the parent value.
labelstring · required
Accessible label for this segment. Rendered as visible text unless isLabelHidden is true.
isLabelHiddenboolean · default false
Whether the label is visually hidden. When true, only the icon is displayed and label is used as aria-label.
iconReactNode
Icon element displayed before the label.
Slot: Icon
isDisabledboolean · default false
Whether this individual item is disabled.