Switch
Ein Ein/Aus-Schalter, der als Formularsteuerelement funktioniert, in zwei Größen.
Verfügbar für
Angular: verfügbar Vue: verfügbar React: verfügbar React Native: verfügbar
Verwendung
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>Import
import {
SoneSwitchComponent,
} from "@surface-one/angular/switch";API-Referenz
SoneSwitchComponentKomponente
| Name | Typ | Standard |
|---|---|---|
ariaLabel | string | null | null |
size | SwitchSize | "default" |
inputId | string | null | null |
invalid | boolean | false |
checked | boolean | false |
disabled | boolean | false |
| Name | Typ |
|---|---|
checkedChange | boolean |