{% extends 'flowbite_test/layout.html.twig' %} {% import 'flowbite_components/macros.html.twig' as flowbite %} {% block title %}Démonstration du Layout Complet{% endblock %} {% block breadcrumb %} {# Utilisation du composant breadcrumb #} {% include 'flowbite_components/layout/_breadcrumb.html.twig' with { items: [ {label: 'Accueil', url: path('flowbite_demo_index')}, {label: 'Démonstrations', url: '#'}, {label: 'Layout Complet'} ] } %} {% endblock %} {% block content %} {# En-tête de la page #}

Démonstration du Layout Complet

Cette page démontre tous les composants du layout modulaire Flowbite : header avec menu utilisateur enrichi, sidebar responsive, breadcrumbs, notifications, et bouton scroll-to-top.

{# Section: Vue d'ensemble du Layout #}

Vue d'ensemble du Layout

{# Card: Header #} {{ flowbite.card( 'Header & Navbar', '', null, 'fa-bars' ) }} {# Card: Sidebar #} {{ flowbite.card( 'Sidebar Navigation', '', null, 'fa-sidebar' ) }} {# Card: Composants #} {{ flowbite.card( 'Composants Additionnels', '', null, 'fa-puzzle-piece' ) }}
{# Section: Exemples de composants #}

Exemples de Composants Flowbite

{# Alerts #}

Alerts

{{ flowbite.alert('success', 'Opération réussie! Vos modifications ont été enregistrées.', true) }} {{ flowbite.alert('info', 'Information: Cette fonctionnalité sera bientôt disponible.', true) }} {{ flowbite.alert('warning', 'Attention: Veuillez vérifier vos informations avant de continuer.', true) }} {{ flowbite.alert('error', 'Erreur: Impossible de se connecter au serveur.', true) }}
{# Buttons #}

Boutons

{{ flowbite.button('Primary', 'primary', 'md') }} {{ flowbite.button('Secondary', 'secondary', 'md') }} {{ flowbite.button('Success', 'success', 'md', 'fa-check') }} {{ flowbite.button('Danger', 'danger', 'md', 'fa-trash') }} {{ flowbite.button('Warning', 'warning', 'md', 'fa-exclamation-triangle') }}
{# Badges #}

Badges

{{ flowbite.badge('Bleu', 'blue') }} {{ flowbite.badge('Vert', 'green', 'fa-check') }} {{ flowbite.badge('Rouge', 'red', 'fa-times') }} {{ flowbite.badge('Jaune', 'yellow', 'fa-star') }} {{ flowbite.badge('Violet', 'purple') }} {{ flowbite.badge('Rose', 'pink') }}
{# Progress Bars #}

Barres de Progression

{{ flowbite.progressBar('Téléchargement', 75, 'blue', true) }} {{ flowbite.progressBar('Installation', 45, 'green', true) }} {{ flowbite.progressBar('Traitement', 90, 'yellow', true) }}
{# Avatars #}

Avatars

{{ flowbite.avatar('JD', 'blue', false) }} {{ flowbite.avatar('MM', 'green', true) }} {{ flowbite.avatar('AB', 'purple', false) }} {{ flowbite.avatar('CD', 'gray', true) }}
{# Section: Formulaire exemple #}

Formulaire Exemple

{{ flowbite.input('username', 'Nom d\'utilisateur', 'text', 'Entrez votre nom', '', true, null, 'fa-user') }} {{ flowbite.input('email', 'Adresse email', 'email', 'exemple@email.com', '', true, null, 'fa-envelope') }} {% set countries = [ {value: 'FR', label: 'France'}, {value: 'BE', label: 'Belgique'}, {value: 'CH', label: 'Suisse'}, {value: 'CA', label: 'Canada'} ] %} {{ flowbite.select('country', 'Pays', countries, 'FR', true) }}
{{ flowbite.button('Enregistrer', 'success', 'md', 'fa-save') }} {{ flowbite.button('Annuler', 'secondary', 'md', 'fa-times') }}
{# Section: Structure des Fichiers #}

Structure des Fichiers du Layout

templates/
├── flowbite_components/
│   ├── layout/
│   │   ├── _header.html.twig          # Navbar avec menu utilisateur
│   │   ├── _sidebar.html.twig         # Navigation latérale
│   │   ├── _breadcrumb.html.twig      # Fil d'Ariane
│   │   ├── _notifications_zone.html.twig  # Zone de toasts
│   │   └── _scroll_to_top.html.twig   # Bouton retour en haut
│   └── macros.html.twig               # Macros réutilisables
└── flowbite_test/
    ├── layout.html.twig               # Layout de base assemblé
    └── full_layout_demo.html.twig     # Cette page de démo
            
{# Section: Comment utiliser #}

Comment Utiliser ce Layout

1. Étendre le layout de base

{% verbatim %}{% extends 'flowbite_test/layout.html.twig' %}

{% block title %}Ma Page{% endblock %}

{% block content %}
    {# Votre contenu ici #}
{% endblock %}{% endverbatim %}

2. Ajouter des breadcrumbs

{% verbatim %}{% block breadcrumb %}
    {% include 'flowbite_components/layout/_breadcrumb.html.twig' with {
        items: [
            {label: 'Accueil', url: path('app_home')},
            {label: 'Ma Section', url: path('my_section')},
            {label: 'Ma Page'}
        ]
    } %}
{% endblock %}{% endverbatim %}

3. Utiliser les macros Flowbite

{% verbatim %}{% import 'flowbite_components/macros.html.twig' as flowbite %}

{{ flowbite.button('Mon Bouton', 'primary', 'md', 'fa-save') }}
{{ flowbite.alert('success', 'Opération réussie!', true) }}
{{ flowbite.card('Titre', 'Contenu de la carte', null, 'fa-star') }}{% endverbatim %}
{# Section: Testez le scroll #}

Testez le Bouton Scroll-to-Top

Scrollez vers le bas de cette page pour voir apparaître le bouton "Retour en haut" en bas à droite. Le bouton apparaît automatiquement après avoir scrollé de 300px et permet de remonter en haut de la page avec une animation smooth.

{# Contenu de remplissage pour le scroll #}
{% for i in 1..10 %}

Section de test #{{ i }}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

{% endfor %}
{# Section: Fonctionnalités responsive #}

Fonctionnalités Responsive

💡 Astuce: Réduisez la taille de votre fenêtre pour voir le layout s'adapter:

{% endblock %}