Feedback
Skeleton
Placeholder animato che simula la forma del contenuto durante il caricamento. Supporta shape rettangolare e circolare con animazioni wave, pulse e none.
Import
import { Skeleton } from '@pzeta/vue-components'
// oppure tramite plugin:
import { FeedbackPlugin } from '@pzeta/vue-components'
app.use(FeedbackPlugin)
Esempio Base
Props
| Prop | Tipo | Default | Descrizione |
|---|---|---|---|
shape | 'rectangle' | 'circle' | 'rectangle' | Forma dello skeleton |
width | string | — | Larghezza (valore CSS, es. '100%', '200px') |
height | string | — | Altezza (valore CSS, es. '1rem', '48px') |
size | string | — | Dimensione unica per circle o quando non si specificano width/height (es. '3rem') |
borderRadius | string | — | Border radius custom CSS (es. '8px') |
animation | 'wave' | 'pulse' | 'none' | 'wave' | Tipo di animazione di caricamento |
class | string | '' | Classe CSS aggiuntiva |
Logica dimensioni
shape="circle"o nessuno trawidth/heightdefiniti: usasizeper entrambe le dimensioni.- Se
widthoheightsono definiti:sizeviene ignorato.
Esempi
Card skeleton
Lista skeleton
Animazioni
Sostituire con contenuto reale
Accessibilità
- Il componente ha
aria-hidden="true"poiché è puramente decorativo. - Il contenuto di caricamento deve essere comunicato agli screen reader dal contenitore padre con
aria-busy="true"earia-live="polite".
TypeScript
import type { SkeletonProps } from '@pzeta/vue-components'
import type { SkeletonShape, SkeletonAnimation } from '@pzeta/vue-components'
// SkeletonShape = 'rectangle' | 'circle'
// SkeletonAnimation = 'wave' | 'pulse' | 'none'