Installation
npx shadcn@latest add @iconiq/r-toggleProps
Toggle
Two-state button with bouncy press feedback and a muted fill that pops in when pressed, layered over Radix UI primitives.
pressedbooleandefaultPressedbooleanDefault false
onPressedChange(pressed: boolean) => voidvariant"default" | "outline"Default "default"
size"default" | "sm" | "lg"Default "default"
disabledbooleanclassNamestringUse aria-label or visible text when the toggle contains only an icon.
Additional primitive props such as value, name, and form attributes are forwarded to the root button.
Motion and interaction behavior
Pressed state drives a horizontal liquid wipe, a one-shot light sheen, and tactile icon motion.
Built on Radix toggle primitives while preserving the same bouncy fill pop, icon snap, and press scale as the Base UI version.
The muted fill wipes in from the left when pressed and retracts to the right on release with a heavy spring.
Each state change sends a diagonal sheen across the surface once. Outline keeps the same outer border in both states.
Icons scale and squash on press with a spring settle.
Registry bundle
Install the exact registry entry shown on the right when you want the component file and its declared runtime dependencies together.
Dependencies: radix-ui, class-variance-authority, motion.
Installs a Radix toggle with the same variant and size API as the Base UI version.
Uses Radix toggle primitives under the same spring background, content lift, and press scale shell.
The generated registry file is /r/r-toggle.json.