{% extends 'base.html.twig' %} {% block title %}User Card - Design System - Bubul{% endblock %} {% block body %}
{% verbatim %}{% include '_molecules/user-card/user-card.html.twig' with {
name: 'Jean Dupont',
email: 'jean@example.com',
role: 'Administrateur',
progress: 75,
progressLabel: 'Complété'
} %}{% endverbatim %}
Paramètre : subtitle — Texte libre sous le nom
{% verbatim %}{% include '_molecules/user-card/user-card.html.twig' with {
name: 'Jean Dupont',
subtitle: 'Membre depuis janvier 2024',
variant: 'bordered'
} %}{% endverbatim %}
Block : {% verbatim %}{% block controls %}{% endverbatim %} — Via embed
{% verbatim %}{% embed '_molecules/user-card/user-card.html.twig' with {
name: 'Jean Dupont',
subtitle: 'Solde : 250 000 tokens',
variant: 'bordered'
} %}
{% block controls %}
{# Slider + Input custom #}
{% endblock %}
{% endembed %}{% endverbatim %}
Exemple : Allocation de tokens par membre (interactif)
Exemple simple avec toggle
Le block controls permet d'injecter n'importe quel élément : toggles, sliders, inputs, boutons custom...
| Paramètre | Type | Défaut | Description |
|---|---|---|---|
name | string | (requis) | Nom de l'utilisateur |
email | string | null | Adresse email |
role | string | null | Rôle/fonction |
subtitle | string | null | Sous-titre personnalisé |
avatar | string | null | URL de l'avatar |
initials | string | auto | Initiales (si pas d'avatar) |
badge | object | null | {text, variant, dot?} |
progress | number | null | Pourcentage pour progress ring |
progressLabel | string | null | Label du progress |
href | string | null | Rend la carte cliquable |
actions | array | null | Actions [{icon, label, onclick?}] |
size | string | md | sm, md, lg |
variant | string | default | default, bordered, elevated |
class | string | '' | Classes CSS additionnelles |