{% extends 'base.html.twig' %} {% block title %}Skeleton - Design System - Bubul{% endblock %} {% block body %}
{# ===== HEADER ===== #}
Atomes /

Skeleton

Placeholder de chargement animé

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

Usage

{% verbatim %}{# Skeleton texte #}
{% include '_atoms/skeleton/skeleton.html.twig' with {
    variant: 'text',
    width: '3/4'
} %}

{# Skeleton avatar #}
{% include '_atoms/skeleton/skeleton.html.twig' with {
    variant: 'avatar'
} %}

{# Skeleton paragraphe (3 lignes) #}
{% include '_atoms/skeleton/skeleton.html.twig' with {
    variant: 'paragraph',
    lines: 3
} %}{% endverbatim %}

Fichier : templates/_atoms/skeleton/skeleton.html.twig

{# ===== VARIANTES ===== #}

Variantes

Paramètre : variant

{# Text #}

text (défaut)

{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'text' } %} {% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'text', width: '3/4' } %} {% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'text', width: '1/2' } %}
{# Title #}

title

{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'title' } %}
{# Avatar #}

avatar (+ avatar-sm, avatar-lg)

{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'avatar-sm' } %} {% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'avatar' } %} {% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'avatar-lg' } %}
{# Button #}

button

{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'button' } %}
{# Input #}

input

{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'input' } %}
{# Thumbnail #}

thumbnail

{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'thumbnail' } %}
{# Card #}

card

{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'card' } %}
{# ===== PARAGRAPH ===== #}

Paragraphe

Paramètre : lines

2 lignes

{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'paragraph', lines: 2 } %}

3 lignes

{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'paragraph', lines: 3 } %}

5 lignes

{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'paragraph', lines: 5 } %}
{# ===== LARGEURS ===== #}

Largeurs

Paramètre : width

{% for w in ['full', '3/4', '2/3', '1/2', '1/3', '1/4'] %}
{{ w }} {% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'text', width: w } %}
{% endfor %}
{# ===== ANIMATIONS ===== #}

Animations

Paramètre : animation

pulse (défaut)

{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'text', animation: 'pulse' } %}

wave (shimmer)

{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'text', animation: 'wave' } %}

none (statique)

{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'text', animation: 'none' } %}
{# ===== EXEMPLES CONCRETS ===== #}

Exemples concrets

{# User card skeleton #}

Carte utilisateur

{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'avatar' } %}
{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'text', width: '3/4' } %} {% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'text', width: '1/2' } %}
{# Article skeleton #}

Article / Post

{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'thumbnail' } %} {% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'title' } %} {% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'paragraph', lines: 3 } %}
{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'avatar-sm' } %} {% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'text', width: '1/3' } %}
{# List skeleton #}

Liste d'éléments

{% for i in 1..4 %}
{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'avatar-sm' } %}
{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'text', width: '2/3' } %} {% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'text', width: '1/3' } %}
{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'button', class: 'w-16' } %}
{% endfor %}
{# Form skeleton #}

Formulaire

{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'text', width: '1/4' } %} {% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'input' } %}
{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'text', width: '1/3' } %} {% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'input' } %}
{% include '_atoms/skeleton/skeleton.html.twig' with { variant: 'button', width: 'full' } %}
{# ===== PARAMÈTRES ===== #}

Paramètres

Paramètre Type Défaut Description
variantstring'text'text, title, avatar, thumbnail, button, card, paragraph, input
widthstring'full'full, 3/4, 2/3, 1/2, 1/3, 1/4 ou valeur CSS
heightstringnullHauteur personnalisée (CSS)
linesnumber1Nombre de lignes (paragraph)
roundedstring'md'none, sm, md, lg, xl, full
animationstring'pulse'pulse, wave, none
{% endblock %}