About
A segmented pill control for switching between a few mutually exclusive views or modes, with a thumb that glides to the selected option.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Switcher to your project and fits it to your theme.
Code
How Switcher is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import * as React from "react";
import Switcher from "@/components/ui/switcher";
export default function SwitcherDemo() {
const [mode, setMode] = React.useState("place");
return (
<Switcher
aria-label="View"
size="compact"
value={mode}
onValueChange={setMode}
options={[
{ value: "place", label: "place" },
{ value: "list", label: "list" },
{ value: "table", label: "table" },
]}
/>
);
}








