{% extends 'base.html.twig' %} {% block title %}Mini Stat - Design System - Bubul{% endblock %} {% block body %}
{% verbatim %}{% include '_molecules/mini-stat/mini-stat.html.twig' with {
value: '1,234',
label: 'tokens',
icon: 'token',
variant: 'primary'
} %}{% endverbatim %}
Paramètre : variant — Utilise les couleurs du Design System
primary-muted
{% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '1,234', label: 'tokens', icon: 'token', variant: 'primary-muted' } %}warning-muted
{% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '0.42', label: 'Wh', icon: 'lightbulb-bolt', variant: 'warning-muted' } %}primary
{% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '1,234', label: 'tokens', icon: 'token', variant: 'primary' } %}success
{% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '100%', label: 'complété', icon: 'check-circle', variant: 'success' } %}warning
{% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '5', label: 'alertes', icon: 'alert', variant: 'warning' } %}muted
{% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '100', label: 'users', icon: 'users', variant: 'muted' } %}default
{% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '42', label: 'items', icon: 'list', variant: 'default' } %}Paramètre : appearance
pill (défaut) - Avec fond coloré
inline - Sans fond (sidebar style)
Paramètre : progress — Affiche une barre sous la statistique
{% verbatim %}{% include '_molecules/mini-stat/mini-stat.html.twig' with {
value: '750',
label: 'tokens utilisés',
icon: 'token',
variant: 'primary',
progress: 75
} %}{% endverbatim %}
Différents niveaux de progression
progress: 25
{% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '250', label: 'tokens', icon: 'token', variant: 'primary', progress: 25 } %}progress: 50
{% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '500', label: 'tokens', icon: 'token', variant: 'primary', progress: 50 } %}progress: 75
{% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '750', label: 'tokens', icon: 'token', variant: 'warning', progress: 75 } %}progress: 100
{% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '1000', label: 'tokens', icon: 'token', variant: 'success', progress: 100 } %}Couleur de la barre selon la variante
| Paramètre | Type | Défaut | Description |
|---|---|---|---|
value | string | '0' | Valeur à afficher |
label | string | null | Label optionnel (ex: 'tokens') |
icon | string | null | Nom de l'icône |
variant | string | default | primary-muted, warning-muted, primary, success, warning, muted, default |
size | string | md | sm, md, lg |
appearance | string | pill | pill (avec fond coloré), inline (sans fond) |
animated | bool | false | Animation de compteur |
progress | number | null | Pourcentage (0-100) pour barre de progression |
class | string | '' | Classes CSS additionnelles |