Get Started
Form
Components
- Accordion
- Alert
- Alert Dialog
- Badge
- Breadcrumbs
- Button Group
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- File Field
- Hover Card
- Kbd
- Menubar
- Navigation Menu
- Number Field
- OTP Field
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Search
- Segmented Control
- Select
- Separator
- Sidebar
- Skeleton
- Slider
- Sonner
- Switch
- Table
- Tabs
- Text Field
- Toggle Group
- Toggle Button
- Tooltip
A linear set of two or more segments, each of which functions as a radio input, and a default value is required.
Component segmented-control-demo not found in registry.
Installation
Install the following dependencies:
Copy and paste the following code into your project:
Usage
import {
SegmentedControl,
SegmentedControlIndicator,
SegmentedControlItem,
SegmentedControlItemInput,
SegmentedControlItemLabel,
SegmentedControlItems,
SegmentedControlList,
} from "@components/ui/segmented-control"<SegmentedControl>
<SegmentedControlList>
<SegmentedControlIndicator />
<SegmentedControlItems>
<SegmentedControlItem>
<SegmentedControlItemInput />
<SegmentedControlItemLabel />
</SegmentedControlItem>
</SegmentedControlItems>
</SegmentedControlList>
</SegmentedControl>Examples
Orientation
The segmented control orientation prop can be used to change the segmented control's orientation.
Component segmented-control-orientation-demo not found in registry.