Installation
npx shadcn@latest add @iconiq/toggleProps
Toggle
8 props
Single pressed-state toggle built on Radix Toggle, with Motion-driven button, icon, and ripple feedback layered over shadcn-style size and variant classes.
children
ReactNodeRequired
Visible button content rendered inside the animated inner span. This can be plain text, icons, or both.
variant
"default" | "outline"Default
defaultVisual treatment from the internal CVA config. Outline adds the input border and shadow-sm treatment.
size
"default" | "sm" | "lg"Default
defaultHeight and horizontal padding preset applied through the shared toggleVariants helper.
pressed
booleanControlled pressed state from Radix Toggle.Root. Use this when the parent should own the on/off state.
defaultPressed
booleanInitial pressed state for uncontrolled usage.
onPressedChange
(pressed: boolean) => voidCalled after the component kicks off its local motion sequence, with the next pressed value from Radix.
disabled
booleanDisables the toggle and prevents the hover, tap, and pressed-state interaction flow.
className
stringMerged onto the rendered motion button for local spacing or surface overrides.
Notes
Additional Radix toggle button props such as aria-label, name, value, and type are forwarded through the underlying Toggle.Root surface.
The component renders Radix Root with asChild internally, then supplies its own motion.button as the child node.