About
A segmented control whose pill slides between options on a spring, squishes when pressed and can be dragged across the segments like the one on iOS. Free component from uibrik (uibrik.com).
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
"use client";
import { SegmentedControl } from "@/components/ui/segmented-control";
import { IconCalendar, IconLayoutGrid, IconLayoutKanban, IconLayoutList } from "@tabler/icons-react";
const PLAIN = ["Day", "Week", "Month", "Year"];
const WITH_ICONS = [
{ value: "grid", label: "Grid", icon: <IconLayoutGrid stroke={1.75} /> },
{ value: "list", label: "List", icon: <IconLayoutList stroke={1.75} /> },
{ value: "board", label: "Board", icon: <IconLayoutKanban stroke={1.75} /> },
{ value: "calendar", label: "Calendar", icon: <IconCalendar stroke={1.75} /> },
];
const { icons, ...props } = {
size: "md" as "sm" | "md" | "lg",
equalWidth: false,
draggable: true,
duration: 0.35,
icons: false,
};
export default function Demo() {
return (
<div className="flex h-screen w-full items-center justify-center px-4">
<SegmentedControl key={String(icons)} {...props} options={icons ? WITH_ICONS : PLAIN} defaultValue={icons ? "list" : "Week"} label={icons ? "Layout" : "Range"} />
</div>
);
}








