Skeleton
A placeholder shape while content loads.
Example
<div class="stack" role="group" aria-busy="true" aria-label="Loading profile"> <focsd-skeleton shape="circle"></focsd-skeleton> <focsd-skeleton lines="3"></focsd-skeleton></div>Usage
Import the module once, then use the tag like any HTML element. Every framework below renders the same element; see Frameworks for setup.
<script type="module"> import '@focsd-dev/components/focsd-skeleton.js';</script>
<focsd-skeleton shape="circle"></focsd-skeleton>import { Skeleton } from '@focsd-dev/react';
export function Example() { return <Skeleton shape="circle"></Skeleton>;}<script setup>import '@focsd-dev/components/focsd-skeleton.js';</script>
<template> <focsd-skeleton shape="circle"></focsd-skeleton></template>// Add CUSTOM_ELEMENTS_SCHEMA to the component's schemas, then:import '@focsd-dev/components/focsd-skeleton.js';
// template<focsd-skeleton shape="circle"></focsd-skeleton><script> import '@focsd-dev/components/focsd-skeleton.js';</script>
<focsd-skeleton shape="circle"></focsd-skeleton>API
Attributes
| Attribute | Property | Type | Default |
|---|---|---|---|
shape | shape | 'text' | 'rect' | 'circle' | text |
lines | lines | number | 1 |
CSS parts
Style the inside of the component with ::part(), for example focsd-skeleton::part(skeleton).
| Part | Description |
|---|---|
skeleton | The skeleton element. |
Accessibility
- Hidden from assistive technology (
aria-hidden). Mark the loading container witharia-busy="true"and announce completion if it matters. - The shimmer stops under reduced motion.
Ask the docs
Hi, what are you building?
Ask about any component, theming, forms or frameworks. I answer with the right component, a snippet and a link to its docs.