{% extends 'base.html.twig' %} {% block title %}Label - Design System - Bubul{% endblock %} {% block body %}
Le composant Label est une étiquette autonome pour les champs de formulaire. Utilisez-le quand vous avez besoin d'un label séparé du champ (ex: layouts custom, fieldsets).
{% verbatim %}{# Label simple #}
{% include '_atoms/form/label.html.twig' with {
text: 'Adresse email',
for: 'email'
} %}
{# Label obligatoire avec tooltip #}
{% include '_atoms/form/label.html.twig' with {
text: 'Mot de passe',
for: 'password',
required: true,
tooltip: 'Minimum 8 caractères'
} %}{% endverbatim %}
Fichier : templates/_atoms/form/label.html.twig
Paramètre : size
Paramètre : variant
Paramètres : required, optional
Accessibilité : L'astérisque obligatoire inclut un sr-only pour les lecteurs d'écran.
Paramètre : icon
Paramètre : tooltip
{% verbatim %}{% include '_atoms/form/label.html.twig' with {
text: 'Mot de passe',
required: true,
tooltip: 'Minimum 8 caractères'
} %}{% endverbatim %}
Paramètre : disabled
| Paramètre | Type | Défaut | Description |
|---|---|---|---|
text | string | (requis) | Texte du label |
for | string | null | ID du champ associé |
size | string | 'md' | sm, md, lg |
variant | string | 'default' | default, secondary, inline |
required | bool | false | Affiche l'astérisque * |
optional | bool | false | Affiche (optionnel) |
icon | string | null | Nom de l'icône |
tooltip | string | null | Texte d'info-bulle |
disabled | bool | false | Style désactivé |