npx gluestack-ui add switchimport { Switch } from '@/components/ui/switch';


export default () => <Switch />;
| Prop | Type | Default | Description |
|---|---|---|---|
isDisabled | boolean | false | When true, the switch is disabled and cannot be toggled |
isInvalid | boolean | false | When true, the switch displays an error state. |
isRequired | boolean | false | When true, sets aria-required="true" on the switch. |
isHovered | boolean | false | When true, the switch displays a hover state. |
value | boolean | false | The value of the switch. If true the switch will be turned on. |
defaultValue | boolean | false | The defaultValue of the switch. If true the switch will be turned on initially. |
onToggle | () => any | - | Callback to be invoked when switch value is changed. |
| Name | Value | Default |
|---|---|---|
size | sm | md | lg | md |