001
A toggle whose thumb stretches as it crosses, trails two droplets behind it and swallows them back up the moment it lands.
akatoggle·goo switch
Run this in any project set up for the shadcn CLI. It copies the Liquid Switch source into your components folder, so the code is yours to change.
npx shadcn@latest add https://devl.dev/r/liquid-switch.jsonImport it and render it. Every prop has a typed default, so it works straight away, and you pass your own data when you’re ready.
import { LiquidSwitch } from "@/components/liquid-switch";
export default function Page() {
return <LiquidSwitch />;
}A free React component in the Liquid collection, written in TypeScript with Tailwind CSS on coss ui. MIT licensed.
Read from the Liquid Switch source. Everything is optional unless it says required. It also accepts Omit<SwitchPrimitive.Root.Props, "children" | "checked" | "defaultChecked" | "onCheckedChange">.
| Prop | Type | Default |
|---|---|---|
| checked | boolean | — |
| defaultChecked | boolean | false |
| onCheckedChange | (checked: boolean) => void | — |
| size | keyof typeof SIZES | "default" |
| tone | keyof typeof TONES | "primary" |
| label | ReactNode | — |
| description | ReactNode | — |