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

Empty State

Affichage pour les états vides et résultats nuls

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

Composition

Icon + Typography + Button = EmptyState
{# ===== USAGE ===== #}

Usage

{% verbatim %}{% include '_molecules/empty-state/empty-state.html.twig' with {
    title: 'Aucun cours',
    description: 'Créez votre premier cours pour commencer.',
    icon: 'book',
    actionText: 'Créer un cours',
    actionHref: '/courses/new'
} %}{% endverbatim %}

Fichier : templates/_molecules/empty-state/empty-state.html.twig

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

Exemples

Recherche sans résultat

{% include '_molecules/empty-state/empty-state.html.twig' with { title: 'Aucun résultat', description: 'Essayez avec d\'autres mots-clés ou affinez vos filtres.', icon: 'search' } %}

Liste vide avec action

{% include '_molecules/empty-state/empty-state.html.twig' with { title: 'Aucun projet', description: 'Créez votre premier projet pour commencer à travailler.', icon: 'folder', actionText: 'Nouveau projet', actionHref: '#', actionIcon: 'plus' } %}

Boîte de réception vide

{% include '_molecules/empty-state/empty-state.html.twig' with { title: 'Boîte de réception vide', description: 'Vous n\'avez aucun message pour le moment.', icon: 'inbox' } %}
{# ===== TAILLES ===== #}

Tailles

Paramètre : size

Small (sm)

{% include '_molecules/empty-state/empty-state.html.twig' with { title: 'Aucun élément', description: 'La liste est vide.', icon: 'list', size: 'sm' } %}

Medium (md) - défaut

{% include '_molecules/empty-state/empty-state.html.twig' with { title: 'Aucun élément', description: 'La liste est vide.', icon: 'list', size: 'md' } %}

Large (lg)

{% include '_molecules/empty-state/empty-state.html.twig' with { title: 'Aucun élément', description: 'La liste est vide.', icon: 'list', size: 'lg' } %}
{# ===== VARIANTES ===== #}

Variantes

Paramètre : variant

Default

{% include '_molecules/empty-state/empty-state.html.twig' with { title: 'Aucune notification', description: 'Vous êtes à jour !', icon: 'bell', variant: 'default' } %}

Card

{% include '_molecules/empty-state/empty-state.html.twig' with { title: 'Aucune notification', description: 'Vous êtes à jour !', icon: 'bell', variant: 'card' } %}
{# ===== CAS D'USAGE ===== #}

Cas d'usage

{% include '_molecules/empty-state/empty-state.html.twig' with { title: 'Aucun cours généré', description: 'Uploadez un PDF pour générer votre premier cours.', icon: 'book', iconColor: 'primary', actionText: 'Créer un cours', actionHref: '#', variant: 'card' } %} {% include '_molecules/empty-state/empty-state.html.twig' with { title: 'Erreur de chargement', description: 'Impossible de charger les données. Veuillez réessayer.', icon: 'alert', iconColor: 'error', actionText: 'Réessayer', actionHref: '#', variant: 'card' } %}
{# ===== PARAMÈTRES ===== #}

Paramètres

Paramètre Type Défaut Description
titlestring(requis)Titre principal
descriptionstringnullDescription secondaire
iconstringinboxNom de l'icône
iconColorstringmutedCouleur de l'icône
actionTextstringnullTexte du bouton
actionHrefstringnullURL du bouton
actionIconstringnullIcône du bouton
sizestringmdsm, md, lg
variantstringdefaultdefault, card, minimal
classstring''Classes additionnelles
{% endblock %}