Skip to content

Skeleton

The bq-skeleton component renders a shimmer loading placeholder in various shapes.

Basic Usage

html
<bq-skeleton></bq-skeleton>

Variants

html
<bq-skeleton variant="text"></bq-skeleton>
<bq-skeleton variant="circle" width="48px" height="48px"></bq-skeleton>
<bq-skeleton variant="rect" width="200px" height="120px"></bq-skeleton>
<bq-skeleton variant="card"></bq-skeleton>

Multiple Text Lines

html
<bq-skeleton variant="text" lines="3"></bq-skeleton>

Custom Dimensions

html
<bq-skeleton variant="rect" width="300px" height="200px"></bq-skeleton>

Properties

PropertyTypeDefaultDescription
variantstring'text'text | circle | rect | card
widthstring'100%'A single CSS width expression such as 240px, 100%, clamp(...), or var(...)
heightstringA single CSS height expression such as 3rem, 40vh, calc(...), or var(...)
linesnumber1Number of text lines (for variant="text")

CSS Parts

PartDescription
skeletonThe skeleton element
linesThe container for text lines

Accessibility

The skeleton uses prefers-reduced-motion to disable the shimmer animation when the user requests reduced motion.

For safety, width and height are treated as a single dimension expression. Values that try to inject additional CSS declarations are ignored.

Released under the MIT License.