Skip to component details
EXEPERTAI LAB
ProductCapabilitiesTrustFAQUI GalleryBlogNews
Sign inOpen app ↗
ProductCapabilitiesTrustFAQUI GalleryBlogNewsSign in
← Browse gallery
Actions·@exepert/ui / SegmentedControl

Segmented Control

A compact single-choice switch for sibling views or modes.

Open in Playground ↗All components

Variants and states

3 copy-ready examples

View switcher

A selected view is visible without opening a menu, and the default state can be changed with arrow keys.

Open in Playground ↗
Starting preview…
import { SegmentedControl } from "@exepert/ui";
import "@exepert/ui/styles.css";
export default function Example() {
  return (
    <SegmentedControl label="Viewport" options={[{ value: "grid", label: "Grid" }, { value: "list", label: "List" }, { value: "table", label: "Table" }]} defaultValue="grid" onValueChange={() => {}} />
  );
}

Usage

Use short labels and keep the set to a small number of mutually exclusive choices.

Props

  • label: string
  • options: array
  • value: string
  • defaultValue: string
  • onValueChange: function

Accessibility

  • Uses a labelled radiogroup and exposes the selected value.
  • Arrow-key support is provided by the control.

Install

Install the pinned public release, then import the component and stylesheet.

npm install @exepert/ui@0.1.0

import { SegmentedControl } from "@exepert/ui";

import "@exepert/ui/styles.css";

EXEPERTAI LAB

Compare supported models, inspect system behaviour, and understand the context around each result.

PrivacyTermsContact

EXEPERT AI is an independent software and AI research lab in Malaysia

Malaysia · hello@exepert.com

Open in Gmail ↗

© 2026 EXEPERT AI. All rights reserved.