Segmented Control

A set of two or more segments, each of which functions as a mutually exclusive button. Based on shadcn/ui's Tabs component pattern, providing a clean way to create toggle controls with single selection.

PreviousNext

Installation

1

Run the CLI

Use the CLI to add the component to your project.

npx @ngzard/ui@latest add segmented

Examples

default

sizes

disabled

API

Inputs

Name Type Default Description
class ClassValue '' Additional CSS classes to apply
zSize 'sm' | 'default' | 'lg' 'default' Size of the segmented control
zOptions SegmentedOption[] [] Array of options to display
zDefaultValue string '' Default selected value
zDisabled boolean false Whether the entire control is disabled
zAriaLabel string 'Segmented control' ARIA label for accessibility

Outputs

Name Type Description
zChange string Emitted when selection changes