VelocityUI logoVelocityUI

Skeleton

Shimmering placeholder for loading states. Renders a single block or a stack of lines, with configurable width, height, and border radius.

Import

tsx
import { Skeleton } from '@velocityuikit/velocityui'

Preview

Single block

Multi-line text

Card skeleton

Props

PropTypeDefaultDescription
widthstring | numberWidth of the skeleton block. Defaults to 100% for multi-line stacks.
heightstring | number'1rem'Height of each skeleton block.
radiusstring | numberBorder radius. Defaults to --vui-radius-sm.
linesnumberWhen greater than 1, renders a stacked column of blocks. The last line renders at 75% width.
gapstring | number'0.5rem'Gap between lines when using multi-line mode.

Examples

Single block

tsx
import { Skeleton } from '@velocityuikit/velocityui'

export default function Example() {
  return <Skeleton width={200} height={20} />
}

Multi-line text

tsx
import { Skeleton } from '@velocityuikit/velocityui'

export default function Example() {
  return <Skeleton lines={4} height={14} />
}

Card skeleton

tsx
import { Skeleton } from '@velocityuikit/velocityui'

export default function Example() {
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: '0.75rem', width: 280 }}>
      <Skeleton height={160} radius={12} />
      <Skeleton height={18} width="60%" />
      <Skeleton lines={3} height={13} />
    </div>
  )
}

Theming

Apply a named theme class to <body> or any parent element. All VelocityUI components inside that element will automatically adopt its colors, shadows, and effects. Combine with a density modifier for complete control:

css
/* Pick any named theme */
<body class="vui-theme-ocean">

/* Add a density modifier (optional) */
<body class="vui-theme-midnight vui-density-compact">
<body class="vui-theme-construction vui-density-spacious">

/* Available themes */
/* default  midnight  ocean  tangerine */
/* construction  glass  soft  high-contrast  monochrome-red */

/* Available densities */
/* vui-density-compact  vui-density-comfortable  vui-density-spacious */