{% extends 'base.html.twig' %} {% block title %}Tag Group - Design System - Bubul{% endblock %} {% block body %}
{% verbatim %}{% include '_molecules/tag-group/tag-group.html.twig' with {
tags: ['PHP', 'Symfony', 'Docker', 'AWS', 'Redis'],
max: 3
} %}{% endverbatim %}
Tous les tags visibles
{% include '_molecules/tag-group/tag-group.html.twig' with { tags: ['PHP', 'Symfony', 'Docker'] } %}Avec troncature (max: 3)
{% include '_molecules/tag-group/tag-group.html.twig' with { tags: ['PHP', 'Symfony', 'Docker', 'AWS', 'Redis', 'PostgreSQL'], max: 3 } %}Paramètre : variant (global) ou tags[].variant (par tag)
Variante globale (appliquée à tous les tags)
Variantes par tag (avec objets)
{% include '_molecules/tag-group/tag-group.html.twig' with { tags: [ { label: 'Actif', variant: 'success' }, { label: 'Premium', variant: 'warning' }, { label: 'Admin', variant: 'primary' }, { label: 'Erreur', variant: 'error' }, { label: 'Info', variant: 'info' } ] } %}Toutes les variantes disponibles
{% include '_molecules/tag-group/tag-group.html.twig' with { tags: [ { label: 'gray', variant: 'gray' }, { label: 'primary', variant: 'primary' }, { label: 'success', variant: 'success' }, { label: 'warning', variant: 'warning' }, { label: 'error', variant: 'error' }, { label: 'info', variant: 'info' }, { label: 'moodia', variant: 'moodia' }, { label: 'serenia', variant: 'serenia' }, { label: 'slidia', variant: 'slidia' }, { label: 'sam', variant: 'sam' } ] } %}Paramètre : size
xs
{% include '_molecules/tag-group/tag-group.html.twig' with { tags: ['PHP', 'Symfony', 'Docker', 'AWS'], max: 2, size: 'xs' } %}sm (défaut)
{% include '_molecules/tag-group/tag-group.html.twig' with { tags: ['PHP', 'Symfony', 'Docker', 'AWS'], max: 2, size: 'sm' } %}md
{% include '_molecules/tag-group/tag-group.html.twig' with { tags: ['PHP', 'Symfony', 'Docker', 'AWS'], max: 2, size: 'md' } %}| Paramètre | Type | Défaut | Description |
|---|---|---|---|
tags | array | (requis) | Liste des tags (strings ou objets) |
tags[].label | string | - | Texte du tag (si objet) |
tags[].variant | string | default | Variante de couleur |
tags[].href | string | null | URL (rend cliquable) |
max | number | null | Nombre max de tags visibles |
size | string | sm | xs, sm, md |
variant | string | default | Variante par défaut des tags |
expandable | bool | false | Permettre d'afficher tous les tags |