{% extends 'base.html.twig' %} {% block title %}Breadcrumb - Design System - Bubul{% endblock %} {% block body %}
{% 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
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' } ] } %}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' } %}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ètre | Type | Défaut | Description |
|---|---|---|---|
items | array | [] | Liste [{label, href?}] |
showHome | bool | true | Afficher icône Home |
homeHref | string | / | URL du lien Home |
separator | string | chevron | chevron, slash, arrow |
size | string | md | sm, md, lg |
class | string | '' | Classes additionnelles |
{% 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".