Segmented
Un contrôle segmenté à choix unique généré à partir de données — le modèle Clair / Sombre / Système.
Disponible pour
Angular: disponible Vue: disponible React: disponible React Native: disponible
Utilisation
<div class="demo-stack" style="justify-items: start">
<sone-segmented [options]="themes" [(value)]="theme" ariaLabel="Theme" />
<sone-segmented [options]="ranges" [(value)]="range" variant="default" size="sm" ariaLabel="Date range" />
<sone-segmented [options]="themesIconOnly" [(value)]="theme" ariaLabel="Theme (compact)" />
<span style="color: var(--text-secondary)">Theme: {{ theme() }} · Range: {{ range() }}</span>
</div>Importation
import {
SoneSegmentedComponent,
} from "@surface-one/angular/segmented";Référence de l’API
SoneSegmentedComponentComposant
| Nom | Type | Par défaut |
|---|---|---|
optionsobligatoire | readonly SegmentOption[] | — |
ariaLabel | string | null | null |
size | ToggleSize | "default" |
variant | ToggleVariant | "outline" |
orientation | ToggleOrientation | "horizontal" |
valuebidirectionnel | string | "" |