About
A pill-style single-select switcher (like Weekly/Monthly/Yearly toggles) with an animated sliding thumb behind the selected option.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Segmented Control to your project and fits it to your theme.
Code
How Segmented Control is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import {
SegmentedControl,
SegmentedControlItem,
} from "@/components/ui/segmented-control";
export default function SegmentedControlDemo() {
return (
<div className="flex items-center justify-center p-10">
<SegmentedControl defaultSelectedKeys={["weekly"]} aria-label="Period">
<SegmentedControlItem id="weekly">Weekly</SegmentedControlItem>
<SegmentedControlItem id="monthly">Monthly</SegmentedControlItem>
<SegmentedControlItem id="yearly">Yearly</SegmentedControlItem>
</SegmentedControl>
</div>
);
}





