Component docs
Loading
"use client";
import { Toggle } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
defaultPressed | boolean | — | Initial pressed state when uncontrolled. |
defaultValue | boolean | — | Initial value when uncontrolled. |
onPressedChange | (pressed: boolean) => void | — | Called with the new pressed state. |
onValueChange | (value: boolean) => void | — | Called with the new value (only when it changes). |
pressed | boolean | — | Pressed state (controlled), aria-pressed. |
value | boolean | — | Current value (controlled); null where it means "nothing selected". |
defaultPressedboolean
Initial pressed state when uncontrolled.
defaultValueboolean
Initial value when uncontrolled.
onPressedChange(pressed: boolean) => void
Called with the new pressed state.
onValueChange(value: boolean) => void
Called with the new value (only when it changes).
pressedboolean
Pressed state (controlled), aria-pressed.
valueboolean
Current value (controlled); null where it means "nothing selected".
Other props are passed to the root element (ButtonHTMLAttributes<HTMLButtonElement>), including className, style, id and aria-* attributes.
<Toggle value>Bold</Toggle>