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

Card

Conteneur flexible avec header, body et footer

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

Composition

Icon + Typography + Button = Card
{# ===== CONTENU FLEXIBLE ===== #}

Que peut-on mettre dans une Card ?

La Card utilise {% verbatim %}{% embed %}{% endverbatim %} au lieu de {% verbatim %}{% include %}{% endverbatim %}, ce qui permet d'injecter n'importe quel contenu HTML via les blocks Twig.

{% verbatim %}{% block body %}{% endverbatim %}

  • - Texte, paragraphes
  • - Images, icones
  • - Listes, tableaux
  • - Formulaires
  • - Autres composants
  • - Statistiques, graphiques

{% verbatim %}{% block footer %}{% endverbatim %}

  • - Boutons d'action
  • - Liens
  • - Metadata (date, auteur)
  • - Pagination
  • - Tags, badges

{% verbatim %}{% block headerAction %}{% endverbatim %}

  • - Bouton menu (3 points)
  • - Badge de statut
  • - Toggle, switch
  • - Bouton d'action rapide
{# ===== USAGE ===== #}

Usage

{% verbatim %}{% embed '_molecules/card/card.html.twig' with {
    title: 'Mon titre',
    subtitle: 'Sous-titre optionnel',
    icon: 'settings'
} %}
    {% block body %}
        

Contenu de la card

{% endblock %} {% block footer %} {% endblock %} {% endembed %}{% endverbatim %}

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

{# ===== VARIANTES ===== #}

Variantes

Paramètre : variant

{# Default #}

Default

{% embed '_molecules/card/card.html.twig' with { title: 'Card Default', variant: 'default' } %} {% block body %}

Style par défaut avec ombre légère et bordure subtile.

{% endblock %} {% endembed %}
{# Elevated #}

Elevated

{% embed '_molecules/card/card.html.twig' with { title: 'Card Elevated', variant: 'elevated' } %} {% block body %}

Ombre plus prononcée pour mise en avant.

{% endblock %} {% endembed %}
{# Bordered #}

Bordered

{% embed '_molecules/card/card.html.twig' with { title: 'Card Bordered', variant: 'bordered' } %} {% block body %}

Bordure plus visible, sans ombre.

{% endblock %} {% endembed %}
{# Flat #}

Flat

{% embed '_molecules/card/card.html.twig' with { title: 'Card Flat', variant: 'flat' } %} {% block body %}

Fond gris subtil, style minimaliste.

{% endblock %} {% endembed %}
{# ===== AVEC HEADER COMPLET ===== #}

Header avec icône

Paramètres : icon, iconColor, subtitle

{% embed '_molecules/card/card.html.twig' with { title: 'Statistiques', subtitle: 'Dernières 24 heures', icon: 'chart', iconColor: 'primary' } %} {% block body %}
1,234

Visiteurs uniques

{% endblock %} {% endembed %} {% embed '_molecules/card/card.html.twig' with { title: 'Revenus', subtitle: 'Ce mois', icon: 'wallet', iconColor: 'success' } %} {% block body %}
+12.5%

Par rapport au mois dernier

{% endblock %} {% endembed %}
{# ===== AVEC FOOTER ===== #}

Avec Footer

Block : {% verbatim %}{% block footer %}{% endverbatim %}

{% embed '_molecules/card/card.html.twig' with { title: 'Utilisateur', icon: 'user', iconColor: 'cohorts' } %} {% block body %}

Jean Dupont

jean.dupont@email.com

{% endblock %} {% block footer %}
{% include '_atoms/button/button.html.twig' with { label: 'Editer', variant: 'outline', size: 'sm' } %} {% include '_atoms/button/button.html.twig' with { label: 'Supprimer', variant: 'ghost', size: 'sm', color: 'error' } %}
{% endblock %} {% endembed %} {% embed '_molecules/card/card.html.twig' with { title: 'Projet', subtitle: 'En cours', icon: 'folder', iconColor: 'warning' } %} {% block body %}

Refonte du site web

{% include '_atoms/progress/progress.html.twig' with { value: 65, size: 'sm' } %}
{% endblock %} {% block footer %}
65% complete {% include '_atoms/button/button.html.twig' with { label: 'Voir', variant: 'primary', size: 'sm' } %}
{% endblock %} {% endembed %}
{# ===== CARD CLIQUABLE ===== #}

Card cliquable

Paramètres : href, hover

{% embed '_molecules/card/card.html.twig' with { title: 'Documentation', icon: 'book', href: '#', iconColor: 'info' } %} {% block body %}

Accédez à la documentation complète du projet.

{% endblock %} {% endembed %} {% embed '_molecules/card/card.html.twig' with { title: 'Support', icon: 'help', href: '#', iconColor: 'warning' } %} {% block body %}

Besoin d'aide ? Contactez notre équipe support.

{% endblock %} {% endembed %} {% embed '_molecules/card/card.html.twig' with { title: 'Paramètres', icon: 'settings', href: '#', iconColor: 'muted' } %} {% block body %}

Configurez votre espace de travail.

{% endblock %} {% endembed %}
{# ===== MODE ACTION (QUICK-ACTION STYLE) ===== #}

Mode Action

Activé quand status est défini — Style quick-action avec animations hover

{# Info box #}

Mode Action transforme la Card en bouton d'action avec : icône avec background, animations au hover (scale, rotation, translation), flèche qui slide-in, et ombre colorée.

{% verbatim %}{% embed '_molecules/card/card.html.twig' with {
    title: 'Créer un cours',
    description: 'Générez un cours depuis un PDF',
    icon: 'bubul-moodia',
    status: 'available',
    href: '/moodia'
} %}{% endembed %}{% endverbatim %}

Status: available (interactif)

{% embed '_molecules/card/card.html.twig' with { title: 'Créer un cours', description: 'Générez un cours complet depuis un PDF en quelques minutes.', icon: 'bubul-moodia', status: 'available', href: '#' } %} {% block body %}{% endblock %} {% endembed %} {% embed '_molecules/card/card.html.twig' with { title: 'Poser une question', description: 'Discutez avec l\'IA et obtenez des réponses instantanées.', icon: 'bubul-serenia', status: 'available', href: '#' } %} {% block body %}{% endblock %} {% endembed %}

Status: locked (non-interactif)

{% embed '_molecules/card/card.html.twig' with { title: 'Créer une présentation', description: 'Générez des slides professionnels automatiquement.', icon: 'bubul-slidia', status: 'locked' } %} {% block body %}{% endblock %} {% endembed %} {% embed '_molecules/card/card.html.twig' with { title: 'Analyser un document', description: 'Extraction intelligente de données depuis vos PDF.', icon: 'document', status: 'locked' } %} {% block body %}{% endblock %} {% endembed %}

Status: coming (bientôt disponible)

{% embed '_molecules/card/card.html.twig' with { title: 'Assistant Sam', description: 'Nouvel outil en cours de développement.', icon: 'bubul-sam', status: 'coming' } %} {% block body %}{% endblock %} {% endembed %} {% embed '_molecules/card/card.html.twig' with { title: 'Générateur de quiz', description: 'Créez des questionnaires interactifs.', icon: 'check-circle', status: 'coming', badge: 'Bientôt' } %} {% block body %}{% endblock %} {% endembed %}

Valeurs de status :

available
  • • Icône scale + rotation au hover
  • • Flèche slide-in depuis la droite
  • • Ombre bleue au hover
  • • Card translate-y au hover
locked
  • • Icône cadenas
  • • Opacité réduite (75%)
  • • Grayscale sur l'icône
  • • Non cliquable
coming
  • • Badge "À venir" automatique
  • • Opacité réduite (75%)
  • • Personnalisable avec `badge`
  • • Non cliquable
{# ===== PADDING ===== #}

Padding

Paramètre : padding

{% embed '_molecules/card/card.html.twig' with { title: 'None', padding: 'none' } %} {% block body %}

padding: none

{% endblock %} {% endembed %} {% embed '_molecules/card/card.html.twig' with { title: 'Small', padding: 'sm' } %} {% block body %}

padding: sm

{% endblock %} {% endembed %} {% embed '_molecules/card/card.html.twig' with { title: 'Medium', padding: 'md' } %} {% block body %}

padding: md (défaut)

{% endblock %} {% endembed %} {% embed '_molecules/card/card.html.twig' with { title: 'Large', padding: 'lg' } %} {% block body %}

padding: lg

{% endblock %} {% endembed %}
{# ===== PARAMÈTRES ===== #}

Paramètres

Paramètre Type Défaut Description
titlestringnullTitre du header
subtitlestringnullSous-titre du header
descriptionstringnullDescription (pour mode action)
iconstringnullNom de l'icône
iconColorstringprimaryCouleur de l'icône
statusstringnullavailable, locked, coming (active le Mode Action)
badgestringnullBadge texte (ex: "Nouveau", "Bientôt")
variantstringdefaultdefault, elevated, bordered, flat
paddingstringmdnone, sm, md, lg
hrefstringnullURL (rend la card cliquable)
hoverboolfalseEffet hover (auto si href)
classstring''Classes additionnelles
{# ===== BLOCKS ===== #}

Blocks Twig

Block Description
{% verbatim %}{% block body %}{% endverbatim %}Contenu principal de la card (requis)
{% verbatim %}{% block footer %}{% endverbatim %}Footer optionnel avec fond gris
{% verbatim %}{% block headerAction %}{% endverbatim %}Action dans le header (bouton, badge...)
{% endblock %}