{% extends 'base.html.twig' %} {% block title %}Stat Card - Design System - Bubul{% endblock %} {% block body %}
{% verbatim %}{% include '_molecules/stat-card/stat-card.html.twig' with {
label: 'Tokens restants',
value: '12,500',
icon: 'token',
variant: 'primary',
trend: 'up',
trendValue: '+15%',
progress: 75,
progressLabel: 'Quota utilisé'
} %}{% endverbatim %}
Fichier : templates/_molecules/stat-card/stat-card.html.twig
Parametre : layout - vertical (defaut) ou horizontal
Vertical (defaut) - Icone au-dessus
{% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Tokens restants', value: '991,726', icon: 'token', variant: 'primary', progress: 67, progressLabel: 'Disponibles' } %}Horizontal - Icone a cote
{% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Tokens restants', value: '991,726', icon: 'token', variant: 'primary', layout: 'horizontal', progress: 67, progressLabel: 'Disponibles' } %}Paramètres : trend + trendValue
Paramètres : progress + progressLabel
Paramètre : size
Small (sm)
Medium (md) - défaut
Large (lg)
Paramètre : variant
| Paramètre | Type | Défaut | Description |
|---|---|---|---|
label | string | (requis) | Titre de la statistique |
value | string | (requis) | Valeur principale |
icon | string | null | Nom de l'icône |
detail | string | null | Texte secondaire |
variant | string | default | default, primary, success, warning, error |
trend | string | null | up, down, neutral |
trendValue | string | null | Valeur du trend (ex: '+12%') |
progress | number | null | Pourcentage 0-100 |
progressLabel | string | null | Label de la progression |
href | string | null | Rend la carte cliquable |
size | string | md | sm, md, lg |
layout | string | vertical | vertical (icone au-dessus), horizontal |
class | string | '' | Classes additionnelles |