{% extends 'base.html.twig' %} {% block title %}Mini Stat - Design System - Bubul{% endblock %} {% block body %}
Molécules /

Mini Stat

Affichage compact de statistique avec icône

{# ===== USAGE ===== #}

Usage

{% verbatim %}{% include '_molecules/mini-stat/mini-stat.html.twig' with {
    value: '1,234',
    label: 'tokens',
    icon: 'token',
    variant: 'primary'
} %}{% endverbatim %}
{# ===== VARIANTES ===== #}

Variantes

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' } %}
{# ===== APPARENCES ===== #}

Apparences

Paramètre : appearance

pill (défaut) - Avec fond coloré

{% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '1,234', label: 'tokens', icon: 'token', variant: 'primary-muted', appearance: 'pill' } %} {% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '0.42', label: 'Wh', icon: 'lightbulb-bolt', variant: 'warning-muted', appearance: 'pill' } %}

inline - Sans fond (sidebar style)

{% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '992', label: 'K tokens', icon: 'token', variant: 'primary', appearance: 'inline' } %} {% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '577,7', label: 'Wh', icon: 'lightbulb-bolt', variant: 'warning', appearance: 'inline' } %}
{# ===== TAILLES ===== #}

Tailles

{% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '1,234', label: 'tokens', icon: 'token', size: 'sm', variant: 'primary' } %} {% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '1,234', label: 'tokens', icon: 'token', size: 'md', variant: 'primary' } %} {% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '1,234', label: 'tokens', icon: 'token', size: 'lg', variant: 'primary' } %}
{# ===== AVEC BARRE DE PROGRESSION ===== #}

Avec barre de progression

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

{% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '60%', icon: 'chart', variant: 'primary', progress: 60 } %}
{% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '80%', icon: 'check', variant: 'success', progress: 80 } %}
{% include '_molecules/mini-stat/mini-stat.html.twig' with { value: '45%', icon: 'alert', variant: 'warning', progress: 45 } %}
{# ===== PARAMÈTRES ===== #}

Paramètres

Paramètre Type Défaut Description
valuestring'0'Valeur à afficher
labelstringnullLabel optionnel (ex: 'tokens')
iconstringnullNom de l'icône
variantstringdefaultprimary-muted, warning-muted, primary, success, warning, muted, default
sizestringmdsm, md, lg
appearancestringpillpill (avec fond coloré), inline (sans fond)
animatedboolfalseAnimation de compteur
progressnumbernullPourcentage (0-100) pour barre de progression
classstring''Classes CSS additionnelles
{% endblock %}