niceui

Segmented Control

A pill tab switcher with a sliding sky indicator that springs between options.

ReactTailwind CSSTypeScriptNavigationMIT · Free

Installation

01

Install with the shadcn CLI.

$ npx shadcn@latest add https://niceui.dev/r/segmented-control.json
02

Or copy the source manually into components/ui/segmented-control.tsx. No extra dependencies.

Usage

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

export default function Example() {
  return <SegmentedControl options={["Day", "Week", "Month"]} />;
}

For AI assistants

This page is also available as Markdown and as a shadcn registry item. Use Copy prompt to hand the full source to Claude, Cursor or v0.