Skip to main content
Mantı UI logoMantı UIv0.12.1
Studio

SegmentedControl

Pass items as { value, label, disabled? }. The RadioGroup machine provides keyboard and form behavior while the indicator follows the selected item.

import { SegmentedControl } from '@manti-ui/react';

const items = [
  { value: 'list', label: 'List' },
  { value: 'grid', label: 'Grid' },
  { value: 'board', label: 'Board' },
];

export default function SegmentedControlBasic() {
  return <SegmentedControl items={items} defaultValue="grid" />;
}

Sizes

API

PropTypeDefaultDescription
itemsSegmentedControlItem[]The segments. Each is `{ value, label, disabled? }`.
size'sm' | 'md' | 'lg''md'Control size.
variantMantiVariant'primary'Variant used for the focus ring.
valuestringControlled selected value.
defaultValuestringInitial selected value for uncontrolled usage.
onValueChange(value: string) => voidCalled whenever the selected value changes.
orientation'horizontal' | 'vertical''horizontal'Layout direction.
namestringForm field name.
disabledbooleanDisable the entire control.

Styling

Anatomy

PartSelectorDescription
root[data-scope="segmented-control"][data-part="root"]The segmented container.
indicator[data-scope="segmented-control"][data-part="indicator"]The pill that slides to the active segment.
item[data-scope="segmented-control"][data-part="item"]Each selectable segment.
item-text[data-scope="segmented-control"][data-part="item-text"]Each segment label.

Tokens

TokenControls
--manti-segmented-control-heightheight
--manti-segmented-control-padding-xpadding x
--manti-segmented-control-radiusradius

Last updated

Built end-to-end with Manti UI components and design tokens. Manti UI is a framework-agnostic design system on Zag.js.

GitHub