RectangleSkeleton

January 27, 2026 ยท View on GitHub

Rectangular skeleton loader component for displaying loading placeholders. Ideal for text, buttons, cards, and content block placeholders.

Usage

import { RectangleSkeleton } from "@docspace/ui-kit/components/rectangle";

<RectangleSkeleton />

<RectangleSkeleton width="200px" height="20px" borderRadius="4" />

<RectangleSkeleton
  title="Loading content..."
  backgroundColor="#e0e0e0"
  foregroundColor="#f5f5f5"
  speed={1.5}
/>

Properties

PropertyTypeDefaultDescription
titlestring""Accessible title for screen readers
xstring"0"X position of rectangle
ystring"0"Y position of rectangle
widthstring"100%"Rectangle and SVG container width
heightstring"32px"Rectangle and SVG container height
borderRadiusstring"3"Corner radius (rx and ry)
backgroundColorstringglobalColors.darkBlackBackground color of the skeleton
foregroundColorstringglobalColors.darkBlackForeground (animated) color
backgroundOpacitynumber0.1Opacity of background
foregroundOpacitynumber0.15Opacity of foreground animation
speednumber2Animation speed in seconds
animatebooleantrueEnable/disable animation
classNamestring-Additional CSS class
styleCSSProperties-Inline styles

Examples

Text Line Placeholder

<RectangleSkeleton width="100%" height="16px" borderRadius="2" />

Button Placeholder

<RectangleSkeleton width="120px" height="40px" borderRadius="8" />

Card Placeholder

<RectangleSkeleton width="300px" height="200px" borderRadius="12" />

Multiple Lines

<div style={{ display: "flex", flexDirection: "column", gap: "8px" }}>
  <RectangleSkeleton width="100%" height="16px" />
  <RectangleSkeleton width="80%" height="16px" />
  <RectangleSkeleton width="60%" height="16px" />
</div>

Disabled Animation

<RectangleSkeleton animate={false} />

Custom Colors

<RectangleSkeleton
  backgroundColor="#f0f0f0"
  foregroundColor="#e0e0e0"
  backgroundOpacity={0.5}
  foregroundOpacity={0.8}
/>