Switch
Interruptor de alternância para preferências booleanas. Suporta rótulo, descrição e desabilitado.
Demonstração
Ativar funcionalidades experimentais. Pode ser instável.
Props
| Prop | Tipo | Padrão | Descrição |
|---|---|---|---|
label | string | — | componentPages.switch_prop_label |
description | string | — | componentPages.switch_prop_description |
checked | boolean | — | componentPages.switch_prop_checked |
onCheckedChange | (checked: boolean) => void | — | componentPages.switch_prop_onCheckedChange |
disabled | boolean | false | componentPages.switch_prop_disabled |
id | string | — | componentPages.switch_prop_id |
Uso
import { Switch } from '@ghiberti85/ui'
// Basic
<Switch id="darkMode" label="Dark mode" />
// With description
<Switch
id="beta"
label="Beta features"
description="Enable experimental features. May be unstable."
/>
// Controlled
<Switch
id="notif"
label="Notifications"
checked={enabled}
onCheckedChange={setEnabled}
/>
// Disabled
<Switch id="airplane" label="Airplane mode" disabled />