AccueilComponentsSkeleton

Skeleton

Espace réservé animé affiché pendant le chargement d'un contenu. Composant de type Box. La forme se règle avec width (100% par défaut), height (16 px par défaut) et borderRadius (4 px par défaut) : •ligne de texte : largeur en pourcentage, faible hauteur •carré : width égale à height •rond : borderRadius égal à la moitié de la taille
ui
Experimental
Ligne
tsx
export const Ligne = () => <Skeleton width="60%" />;
Carre
tsx
export const Carre = () => <Skeleton width={64} height={64} />;
Rond
tsx
export const Rond = () => <Skeleton width={48} height={48} borderRadius="full" />;
Rectangle
tsx
export const Rectangle = () => <Skeleton height={160} borderRadius="md" />;
Paragraphe
Des lignes de largeurs décroissantes imitent un paragraphe de texte.
tsx
export const Paragraphe = () => (
<Box display="flex" flexDirection="column" gap="1V" width="100%">
<Skeleton width="40%" height={20} />
<Skeleton />
<Skeleton width="90%" />
<Skeleton width="65%" />
</Box>
);
ElementDeListe
Les formes se composent pour préfigurer un élément de liste : un avatar rond, un titre et un sous-titre.
tsx
export const ElementDeListe = () => (
<Box display="flex" flexDirection="column" gap="2W" width="100%">
{[0, 1, 2].map(i => (
<Box key={i} display="flex" flexDirection="row" gap="1W" style={{ alignItems: 'center' }}>
<Skeleton width={40} height={40} borderRadius="full" />
<Box display="flex" flexDirection="column" gap="1V" flex={1}>
<Skeleton width="40%" height={18} />
<Skeleton width="65%" height={14} />
</Box>
</Box>
))}
</Box>
Alveole UI Kit — v2.0.0-alpha.30