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

Stat Card

Carte de statistique pour dashboards

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

Composition

Icon + Typography + Progress = StatCard
{# ===== USAGE ===== #}

Usage

{% 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

{# ===== LAYOUTS ===== #}

Layouts

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' } %}
{# ===== EXEMPLES DE BASE ===== #}

Exemples de base

{% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Utilisateurs', value: '1,234', icon: 'users' } %} {% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Cours generes', value: '89', icon: 'book', variant: 'primary' } %} {% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Taux de succes', value: '98.5%', icon: 'check-circle', variant: 'success' } %} {% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Erreurs', value: '3', icon: 'alert', variant: 'error' } %}
{# ===== AVEC TREND ===== #}

Avec indicateur de tendance

Paramètres : trend + trendValue

{% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Revenus', value: '12,450 EUR', icon: 'wallet', variant: 'success', trend: 'up', trendValue: '+23%', detail: 'vs mois dernier' } %} {% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Dépenses', value: '3,200 EUR', icon: 'cart', variant: 'warning', trend: 'down', trendValue: '-8%', detail: 'vs mois dernier' } %} {% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Abonnés', value: '5,678', icon: 'heart', variant: 'primary', trend: 'neutral', trendValue: '0%', detail: 'Stable' } %}
{# ===== AVEC PROGRESSION ===== #}

Avec barre de progression

Paramètres : progress + progressLabel

{% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Tokens restants', value: '12,500', icon: 'token', variant: 'primary', progress: 75, progressLabel: 'Quota utilisé' } %} {% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Stockage', value: '4.2 GB', icon: 'cloud', variant: 'warning', progress: 84, progressLabel: 'Sur 5 GB' } %} {% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Objectif mensuel', value: '89 / 100', icon: 'target', variant: 'success', progress: 89, progressLabel: 'Presque atteint !' } %} {% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Quota API', value: '9,800', icon: 'server', variant: 'error', progress: 98, progressLabel: 'Attention: limite proche' } %}
{# ===== TAILLES ===== #}

Tailles

Paramètre : size

Small (sm)

{% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Sessions', value: '234', icon: 'eye', size: 'sm' } %}

Medium (md) - défaut

{% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Sessions', value: '234', icon: 'eye', size: 'md' } %}

Large (lg)

{% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Sessions', value: '234', icon: 'eye', size: 'lg' } %}
{# ===== VARIANTES ===== #}

Variantes

Paramètre : variant

{% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Default', value: '1,234', icon: 'chart', variant: 'default' } %} {% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Primary', value: '1,234', icon: 'chart', variant: 'primary' } %} {% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Success', value: '1,234', icon: 'chart', variant: 'success' } %} {% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Warning', value: '1,234', icon: 'chart', variant: 'warning' } %} {% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Error', value: '1,234', icon: 'chart', variant: 'error' } %}
{# ===== CAS D'USAGE DASHBOARD ===== #}

Cas d'usage : Dashboard Bubul

{% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Tokens disponibles', value: '45,230', icon: 'token', variant: 'primary', trend: 'down', trendValue: '-2,500', detail: 'Consommés ce mois', progress: 68, progressLabel: 'Quota restant' } %} {% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Cours Moodia', value: '23', icon: 'book', variant: 'success', trend: 'up', trendValue: '+5', detail: 'Ce mois' } %} {% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Présentations Slidia', value: '12', icon: 'presentation-graph', variant: 'warning', trend: 'up', trendValue: '+3', detail: 'Ce mois' } %} {% include '_molecules/stat-card/stat-card.html.twig' with { label: 'Conversations Serenia', value: '156', icon: 'message', variant: 'primary', trend: 'up', trendValue: '+42', detail: 'Ce mois' } %}
{# ===== PARAMÈTRES ===== #}

Paramètres

Paramètre Type Défaut Description
labelstring(requis)Titre de la statistique
valuestring(requis)Valeur principale
iconstringnullNom de l'icône
detailstringnullTexte secondaire
variantstringdefaultdefault, primary, success, warning, error
trendstringnullup, down, neutral
trendValuestringnullValeur du trend (ex: '+12%')
progressnumbernullPourcentage 0-100
progressLabelstringnullLabel de la progression
hrefstringnullRend la carte cliquable
sizestringmdsm, md, lg
layoutstringverticalvertical (icone au-dessus), horizontal
classstring''Classes additionnelles
{% endblock %}