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

Level Indicator

Barres visuelles pour difficulté/priorité

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

Usage

{% verbatim %}{% include '_molecules/level-indicator/level-indicator.html.twig' with {
    level: 2,
    maxLevel: 3,
    showLabel: true
} %}{% endverbatim %}
{# ===== NIVEAUX ===== #}

Niveaux (auto-coloring)

Niveau 1 {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 1, maxLevel: 3, showLabel: true } %}
Niveau 2 {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 2, maxLevel: 3, showLabel: true } %}
Niveau 3 {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 3, maxLevel: 3, showLabel: true } %}
{# ===== STYLES ===== #}

Styles

Paramètre : style

equal (défaut) - Barres de même hauteur

{% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 1, maxLevel: 4, style: 'equal', variant: 'primary' } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 2, maxLevel: 4, style: 'equal', variant: 'primary' } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 3, maxLevel: 4, style: 'equal', variant: 'primary' } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 4, maxLevel: 4, style: 'equal', variant: 'primary' } %}

progressive - Barres avec hauteurs croissantes

{% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 1, maxLevel: 4, style: 'progressive', variant: 'primary' } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 2, maxLevel: 4, style: 'progressive', variant: 'primary' } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 3, maxLevel: 4, style: 'progressive', variant: 'primary' } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 4, maxLevel: 4, style: 'progressive', variant: 'primary' } %}
{# ===== PERSONNALISATION ===== #}

Personnalisation

Paramètres : barWidth, gap

Barres fines et serrées (style Moodia)

{% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 1, maxLevel: 4, style: 'progressive', variant: 'primary', barWidth: 'w-[3px]', gap: 'gap-0.5' } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 2, maxLevel: 4, style: 'progressive', variant: 'primary', barWidth: 'w-[3px]', gap: 'gap-0.5' } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 3, maxLevel: 4, style: 'progressive', variant: 'primary', barWidth: 'w-[3px]', gap: 'gap-0.5' } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 4, maxLevel: 4, style: 'progressive', variant: 'primary', barWidth: 'w-[3px]', gap: 'gap-0.5' } %}

Barres très fines (style minimal)

{% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 1, maxLevel: 4, style: 'progressive', variant: 'warning', barWidth: 'w-px', gap: 'gap-px' } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 2, maxLevel: 4, style: 'progressive', variant: 'warning', barWidth: 'w-px', gap: 'gap-px' } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 3, maxLevel: 4, style: 'progressive', variant: 'warning', barWidth: 'w-px', gap: 'gap-px' } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 4, maxLevel: 4, style: 'progressive', variant: 'warning', barWidth: 'w-px', gap: 'gap-px' } %}

Barres larges et espacées

{% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 1, maxLevel: 4, variant: 'error', barWidth: 'w-2', gap: 'gap-1.5' } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 2, maxLevel: 4, variant: 'error', barWidth: 'w-2', gap: 'gap-1.5' } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 3, maxLevel: 4, variant: 'error', barWidth: 'w-2', gap: 'gap-1.5' } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 4, maxLevel: 4, variant: 'error', barWidth: 'w-2', gap: 'gap-1.5' } %}
{# ===== LABELS PERSONNALISÉS ===== #}

Labels personnalisés

{% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 1, maxLevel: 4, showLabel: true, labels: ['Débutant', 'Intermédiaire', 'Avancé', 'Expert'] } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 2, maxLevel: 4, showLabel: true, labels: ['Débutant', 'Intermédiaire', 'Avancé', 'Expert'] } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 3, maxLevel: 4, showLabel: true, labels: ['Débutant', 'Intermédiaire', 'Avancé', 'Expert'] } %} {% include '_molecules/level-indicator/level-indicator.html.twig' with { level: 4, maxLevel: 4, showLabel: true, labels: ['Débutant', 'Intermédiaire', 'Avancé', 'Expert'] } %}
{# ===== PARAMÈTRES ===== #}

Paramètres

Paramètre Type Défaut Description
levelnumber1Niveau actuel (1 à maxLevel)
maxLevelnumber3Nombre total de barres
sizestringmdsm, md, lg
variantstringautoauto, primary, success, warning, error, muted
stylestringequalequal (même hauteur), progressive (croissant)
barWidthstringnullLargeur personnalisée (ex: 'w-1', 'w-[3px]')
gapstringnullEspacement personnalisé (ex: 'gap-px', 'gap-0.5')
showLabelboolfalseAfficher le label de niveau
labelsarraynullLabels personnalisés par niveau
classstring''Classes CSS additionnelles
{% endblock %}