52 Pro components and page blocks

Get Pro

Segmented Control

New

Preview

Customize

Medium
Duration0.35s

Usage

import { SegmentedControl } from "@/components/uibrik/segmented-control/segmented-control";

<SegmentedControl options={options} />

Installation

npx shadcn@latest add https://uibrik.com/r/segmented-control.json
Adds the files to components/uibrik/segmented-control and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/segmented-control.

Props

SegmentedControl
size
Type "sm" | "md" | "lg"
"md"
Height and text size.
equalWidth
Type boolean
false
Give every segment the width of the widest one.
draggable
Type boolean
true
Press the selected segment and drag to scrub across the others.
duration
Type number
0.35
How long the pill takes to slide.
optionsrequired
Type (string | { value; label; icon?; disabled? })[]
–
Segments in order.
value / onChange
Type string / (value) => void
–
Controlled selection.
defaultValue
Type string
–
Selection on mount when uncontrolled. Defaults to the first option.
label
Type string
–
Names the group for screen readers.
className
Type string
–
Classes for the bar.