Toggle

A two-state button that can be toggled on or off.

Import

Usage

Toggle Props

AttributeTypeDefaultDescription
pressedboolean-The controlled pressed state of the toggle.
defaultPressedboolean-The default pressed state (uncontrolled).
onPressedChange(pressed: boolean) => void-Callback when the pressed state changes.
variant'default' | 'outline''default'The visual style of the toggle.
size'default' | 'sm' | 'lg''default'The size of the toggle.
disabledbooleanfalseWhether the toggle is disabled.
classNamestring-Additional CSS classes for styling.