Composants
Groupe de boutons radio
Un ensemble d’options dont une seule peut être sélectionnée.
Utilisation
Basique
HTML
<bs:bsui-radio-group defaultValue="pro">
<bs:bsui-radio value="free" label="Free" />
<bs:bsui-radio value="pro" label="Pro" />
<bs:bsui-radio value="enterprise" label="Enterprise" />
</bs:bsui-radio-group>Horizontal
L’orientation dispose une courte liste d’options sur une ligne.
HTML
<bs:bsui-radio-group name="priority" defaultValue="normal" orientation="horizontal">
<bs:bsui-radio value="low" label="Low" />
<bs:bsui-radio value="normal" label="Normal" />
<bs:bsui-radio value="urgent" label="Urgent" />
</bs:bsui-radio-group>Option indisponible
Une option peut être désactivée pendant que le reste du groupe demeure utilisable.
HTML
<bs:bsui-radio-group name="plan" defaultValue="pro">
<bs:bsui-radio value="free" label="Free" />
<bs:bsui-radio value="pro" label="Pro" />
<bs:bsui-radio value="enterprise" label="Enterprise, contact sales" disabled="true" />
</bs:bsui-radio-group>Dans un champ
Le libellé, le texte d’aide et l’erreur s’appliquent à tout le groupe, et non à une option en particulier.
HTML
<bs:bsui-field invalid="true">
<bs:bsui-field-label text="Where should backups live?" />
<bs:bsui-radio-group name="backups">
<bs:bsui-radio value="eu" label="Europe" />
<bs:bsui-radio value="us" label="United States" />
</bs:bsui-radio-group>
<bs:bsui-field-description text="This cannot be changed after the first backup runs." />
<bs:bsui-field-error text="Pick a region to enable backups." />
</bs:bsui-field>Anatomie
Groupe de boutons radio est composé des blocs ci-dessous. Chacun est un bloc distinct qui ne s’affiche qu’à l’intérieur de son parent.
bsui/radio-groupbsui/radio
Attributs
| Attribut | Type | Par défaut |
|---|---|---|
defaultValue | text | — |
name | text | — |
disabled | toggle | false |
orientation | vertical | |
nameAlt | text | — |
onChange | text | — |
value | text | — |
bsui/radio
| Attribut | Type | Par défaut |
|---|---|---|
value | text | — |
label | richtext | — |
disabled | toggle | false |
bindText | text | — |