Skeleton
A placeholder preview of your content before the data gets loaded to reduce load-time frustration.
Install
Run the following command to install the skeleton component:
npx acc-nuxt add Skeleton
Variants
Pulse
<AcceleratorSkeleton variant="pulse" :style="{ width: '100%', height: '100px' }" />
Wave
<AcceleratorSkeleton variant="wave" :style="{ width: '100%', height: '100px' }" />
Examples
Card with Text
<div class="card-example">
<div class="card-header">
<AcceleratorSkeleton :style="{ width: '40px', height: '40px', borderRadius: '50%' }" />
<div class="card-title-lines">
<AcceleratorSkeleton :style="{ width: '70%', height: '15px', borderRadius: '4px' }" />
<AcceleratorSkeleton :style="{ width: '50%', height: '12px', borderRadius: '4px' }" />
</div>
</div>
<div class="card-body">
<AcceleratorSkeleton :style="{ width: '100%', height: '12px', borderRadius: '4px' }" />
<AcceleratorSkeleton :style="{ width: '100%', height: '12px', borderRadius: '4px' }" />
<AcceleratorSkeleton :style="{ width: '80%', height: '12px', borderRadius: '4px' }" />
</div>
</div>
Avatar
<AcceleratorSkeleton :style="{ width: '60px', height: '60px', borderRadius: '50%' }" />
Inline
The skeleton will adapt to the height of its parent element.
<h1>
<AcceleratorSkeleton inline variant="wave" />
</h1>
Props
default:undefined
Custom CSS class to apply to the skeleton element.
default:pulse
The animation style of the skeleton. Available options: pulse, wave.
default:false
When true, inherits the height of the parent element. Rendered as <span>.
CSS Variables
The skeleton component can be customized using the following CSS variables.
default:rgba(20, 20, 20, 0.1)
Background color of the skeleton.