{% extends 'base.html.twig' %} {% block title %}Breadcrumb - Design System - Bubul{% endblock %} {% block body %}
{# ===== HEADER ===== #}
Molécules /

Breadcrumb

Fil d'ariane pour la navigation hiérarchique

{# ===== COMPOSITION ===== #}

Composition

Icon + Link + Separator = Breadcrumb
{# ===== USAGE ===== #}

Usage

{% verbatim %}{% include '_molecules/breadcrumb/breadcrumb.html.twig' with {
    items: [
        { label: 'Dashboard', href: '/dashboard' },
        { label: 'Utilisateurs', href: '/users' },
        { label: 'Jean Dupont' }
    ]
} %}{% endverbatim %}

Fichier : templates/_molecules/breadcrumb/breadcrumb.html.twig

{# ===== EXEMPLES ===== #}

Exemples

Avec Home

{% include '_molecules/breadcrumb/breadcrumb.html.twig' with { items: [ { label: 'Dashboard', href: '#' }, { label: 'Utilisateurs', href: '#' }, { label: 'Jean Dupont' } ] } %}

Sans Home

{% include '_molecules/breadcrumb/breadcrumb.html.twig' with { items: [ { label: 'Produits', href: '#' }, { label: 'Catégorie', href: '#' }, { label: 'Article' } ], showHome: false } %}

Chemin long

{% include '_molecules/breadcrumb/breadcrumb.html.twig' with { items: [ { label: 'Admin', href: '#' }, { label: 'Design System', href: '#' }, { label: 'Molécules', href: '#' }, { label: 'Breadcrumb' } ] } %}
{# ===== SÉPARATEURS ===== #}

Séparateurs

Paramètre : separator

Chevron (défaut)

{% include '_molecules/breadcrumb/breadcrumb.html.twig' with { items: [ { label: 'Home', href: '#' }, { label: 'Section', href: '#' }, { label: 'Page' } ], separator: 'chevron' } %}

Arrow

{% include '_molecules/breadcrumb/breadcrumb.html.twig' with { items: [ { label: 'Home', href: '#' }, { label: 'Section', href: '#' }, { label: 'Page' } ], separator: 'arrow' } %}
{# ===== TAILLES ===== #}

Tailles

Paramètre : size

Small (sm)

{% include '_molecules/breadcrumb/breadcrumb.html.twig' with { items: [ { label: 'Dashboard', href: '#' }, { label: 'Settings', href: '#' }, { label: 'Profile' } ], size: 'sm' } %}

Medium (md) - défaut

{% include '_molecules/breadcrumb/breadcrumb.html.twig' with { items: [ { label: 'Dashboard', href: '#' }, { label: 'Settings', href: '#' }, { label: 'Profile' } ], size: 'md' } %}

Large (lg)

{% include '_molecules/breadcrumb/breadcrumb.html.twig' with { items: [ { label: 'Dashboard', href: '#' }, { label: 'Settings', href: '#' }, { label: 'Profile' } ], size: 'lg' } %}
{# ===== PARAMÈTRES ===== #}

Paramètres

Paramètre Type Défaut Description
itemsarray[]Liste [{label, href?}]
showHomebooltrueAfficher icône Home
homeHrefstring/URL du lien Home
separatorstringchevronchevron, slash, arrow
sizestringmdsm, md, lg
classstring''Classes additionnelles
{# ===== STRUCTURE ITEMS ===== #}

Structure des items

{% verbatim %}items: [
    { label: 'Dashboard', href: '/dashboard' },  // Lien cliquable
    { label: 'Utilisateurs', href: '/users' },   // Lien cliquable
    { label: 'Jean Dupont' }                     // Texte seul (page courante)
]{% endverbatim %}

Le dernier élément est automatiquement affiché comme texte (sans lien) avec aria-current="page".

{% endblock %}