{% extends 'base.html.twig' %} {% block title %}Tag - Design System - Bubul{% endblock %} {% block body %}
{# ===== HEADER ===== #}
Atomes /

Tag

Étiquette supprimable pour filtres et catégories

{# ===== USAGE ===== #}

Usage

{% verbatim %}{# Tag simple #}
{% include '_atoms/tag/tag.html.twig' with {
    label: 'JavaScript'
} %}

{# Tag supprimable #}
{% include '_atoms/tag/tag.html.twig' with {
    label: 'React',
    color: 'primary',
    removable: true
} %}

{# Tag sélectionné #}
{% include '_atoms/tag/tag.html.twig' with {
    label: 'Actif',
    color: 'success',
    selected: true
} %}{% endverbatim %}

Fichier : templates/_atoms/tag/tag.html.twig

{# ===== TAILLES ===== #}

Tailles

Paramètre : size

{% include '_atoms/tag/tag.html.twig' with { label: 'Small', size: 'sm' } %} {% include '_atoms/tag/tag.html.twig' with { label: 'Medium', size: 'md' } %} {% include '_atoms/tag/tag.html.twig' with { label: 'Large', size: 'lg' } %}
{# ===== COULEURS ===== #}

Couleurs

Paramètre : color

{% for colorName in ['gray', 'primary', 'success', 'warning', 'error', 'info'] %} {% include '_atoms/tag/tag.html.twig' with { label: colorName, color: colorName } %} {% endfor %}

Couleurs produits Bubul

{% include '_atoms/tag/tag.html.twig' with { label: 'Moodia', color: 'moodia' } %} {% include '_atoms/tag/tag.html.twig' with { label: 'Serenia', color: 'serenia' } %} {% include '_atoms/tag/tag.html.twig' with { label: 'Slidia', color: 'slidia' } %} {% include '_atoms/tag/tag.html.twig' with { label: 'SAM', color: 'sam' } %}
{# ===== SUPPRIMABLE ===== #}

Tags supprimables

Paramètre : removable: true

{% include '_atoms/tag/tag.html.twig' with { label: 'JavaScript', color: 'primary', removable: true } %} {% include '_atoms/tag/tag.html.twig' with { label: 'PHP', color: 'primary', removable: true } %} {% include '_atoms/tag/tag.html.twig' with { label: 'Python', color: 'primary', removable: true } %} {% include '_atoms/tag/tag.html.twig' with { label: 'TypeScript', color: 'primary', removable: true } %}

Cliquer sur × pour supprimer (nécessite JavaScript pour l'action)

{# ===== SÉLECTIONNÉ ===== #}

État sélectionné

Paramètre : selected: true

Non sélectionné vs Sélectionné

{% include '_atoms/tag/tag.html.twig' with { label: 'Moodia', color: 'moodia' } %} {% include '_atoms/tag/tag.html.twig' with { label: 'Moodia', color: 'moodia', selected: true } %}

Groupe de filtres

{% include '_atoms/tag/tag.html.twig' with { label: 'Tous', color: 'gray', selected: true } %} {% include '_atoms/tag/tag.html.twig' with { label: 'Moodia', color: 'moodia' } %} {% include '_atoms/tag/tag.html.twig' with { label: 'Serenia', color: 'serenia' } %} {% include '_atoms/tag/tag.html.twig' with { label: 'Slidia', color: 'slidia' } %}
{# ===== AVEC ICÔNE ===== #}

Avec icône

Paramètre : icon

{% include '_atoms/tag/tag.html.twig' with { label: 'Moodia', color: 'moodia', icon: 'bubul-moodia' } %} {% include '_atoms/tag/tag.html.twig' with { label: 'Serenia', color: 'serenia', icon: 'bubul-serenia' } %} {% include '_atoms/tag/tag.html.twig' with { label: 'Slidia', color: 'slidia', icon: 'bubul-slidia' } %} {% include '_atoms/tag/tag.html.twig' with { label: 'Fichier', color: 'gray', icon: 'file-text' } %} {% include '_atoms/tag/tag.html.twig' with { label: 'Utilisateur', color: 'primary', icon: 'user' } %}
{# ===== ÉTATS ===== #}

États

{% include '_atoms/tag/tag.html.twig' with { label: 'Normal', color: 'primary' } %}

Normal

{% include '_atoms/tag/tag.html.twig' with { label: 'Sélectionné', color: 'primary', selected: true } %}

Sélectionné

{% include '_atoms/tag/tag.html.twig' with { label: 'Désactivé', color: 'primary', disabled: true } %}

Désactivé

{% include '_atoms/tag/tag.html.twig' with { label: 'Avec lien', color: 'primary', href: '#' } %}

Cliquable

{# ===== EXEMPLE CONCRET ===== #}

Exemple : Filtres de cours Moodia

Filtres actifs

{% include '_atoms/tag/tag.html.twig' with { label: 'Marketing', color: 'primary', removable: true } %} {% include '_atoms/tag/tag.html.twig' with { label: 'Débutant', color: 'success', removable: true } %} {% include '_atoms/tag/tag.html.twig' with { label: '< 2h', color: 'gray', removable: true } %}

Catégories

{% include '_atoms/tag/tag.html.twig' with { label: 'Tous', color: 'gray' } %} {% include '_atoms/tag/tag.html.twig' with { label: 'Marketing', color: 'gray', selected: true } %} {% include '_atoms/tag/tag.html.twig' with { label: 'RH', color: 'gray' } %} {% include '_atoms/tag/tag.html.twig' with { label: 'Finance', color: 'gray' } %} {% include '_atoms/tag/tag.html.twig' with { label: 'IT', color: 'gray' } %}
{# ===== PARAMÈTRES ===== #}

Paramètres

Paramètre Type Défaut Description
labelstring(requis)Texte du tag
colorstring'gray'gray, primary, success, moodia, serenia...
sizestring'md'sm, md, lg
removableboolfalseAfficher le bouton ×
iconstringnullNom de l'icône
selectedboolfalseÉtat sélectionné (fond plein)
disabledboolfalseÉtat désactivé
hrefstringnullURL (rend le tag cliquable)
{% endblock %}