Skip to content
Focsd homeFocsd homeFocsd
Forms

Skeleton

A placeholder shape while content loads.

  • Tag: focsd-skeleton
  • Pattern: aria-busy placeholder
  • Category: Feedback

Example

HTML
<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>

API

Attributes

AttributePropertyTypeDefault
shapeshape'text' | 'rect' | 'circle'text
lineslinesnumber1

CSS parts

Style the inside of the component with ::part(), for example focsd-skeleton::part(skeleton).

PartDescription
skeletonThe skeleton element.

Accessibility

  • Hidden from assistive technology (aria-hidden). Mark the loading container with aria-busy="true" and announce completion if it matters.
  • The shimmer stops under reduced motion.