Switch
Un interrupteur marche/arrêt utilisable comme contrôle de formulaire, en deux tailles.
Disponible pour
Angular: disponible Vue: disponible React: disponible React Native: disponible
Utilisation
On — show text while people speak.
Small size, for dense settings lists.
Managed by your administrator.
<div soneFieldGroup variant="choices" style="max-width: 26rem">
<div soneField orientation="horizontal">
<div soneFieldContent>
<label soneFieldLabel for="demo-captions">Live captions</label>
<p soneFieldDescription>{{ captions() ? 'On' : 'Off' }} — show text while people speak.</p>
</div>
<sone-switch inputId="demo-captions" [(checked)]="captions" />
</div>
<div soneField orientation="horizontal">
<div soneFieldContent>
<label soneFieldLabel for="demo-compact">Compact layout</label>
<p soneFieldDescription>Small size, for dense settings lists.</p>
</div>
<sone-switch inputId="demo-compact" size="sm" [(checked)]="compact" />
</div>
<div soneField orientation="horizontal" disabled>
<div soneFieldContent>
<label soneFieldLabel for="demo-sync">Cloud sync</label>
<p soneFieldDescription>Managed by your administrator.</p>
</div>
<sone-switch inputId="demo-sync" checked disabled />
</div>
</div>Importation
import {
SoneSwitchComponent,
} from "@surface-one/angular/switch";Référence de l’API
SoneSwitchComponentComposant
| Nom | Type | Par défaut |
|---|---|---|
ariaLabel | string | null | null |
size | SwitchSize | "default" |
inputId | string | null | null |
invalid | boolean | false |
checked | boolean | false |
disabled | boolean | false |
| Nom | Type |
|---|---|
checkedChange | boolean |