sgds-components-skeleton
SKILL.md
SGDS Skeleton Component Skill
<sgds-skeleton> renders a placeholder shape to represent content that is still loading. Use it to reduce perceived loading time and prevent layout shift when data is being fetched.
Prerequisites
See sgds-components-setup for installation and framework integration (React 19+ vs React ≤18, Vue, Angular).
No CSS styling modifications — custom properties and CSS parts are not exposed on this component.
Quick Decision Guide
Size the skeleton to match the real content it replaces — set width and height with CSS units (e.g., "200px", "100%", "1.5rem").
Shape?
- Rectangle (default) → omit
borderRadius - Rounded rectangle (card, button) → e.g.,
borderRadius="4px" - Circle (avatar) →
borderRadius="50%"with equalwidthandheight
Multiple lines of text?
- Use
rowsto render several skeleton lines stacked withinheight
Animated shimmer?
- Add
sheenfor a horizontal shimmer animation
<!-- Rectangle placeholder -->
<sgds-skeleton width="200px" height="20px"></sgds-skeleton>
<!-- Rounded rectangle (card) -->
<sgds-skeleton width="128px" height="64px" borderRadius="4px"></sgds-skeleton>
<!-- Circle (avatar) -->
<sgds-skeleton width="96px" height="96px" borderRadius="50%"></sgds-skeleton>
<!-- Multiple text lines -->
<sgds-skeleton width="100%" height="80px" rows="3"></sgds-skeleton>
<!-- Animated shimmer -->
<sgds-skeleton width="200px" height="20px" sheen></sgds-skeleton>
API Summary
| Attribute | Type | Default | Purpose |
|---|---|---|---|
width |
string | — | Width with CSS unit (e.g. "200px", "100%") |
height |
string | — | Height with CSS unit |
borderRadius |
string | — | Border radius with CSS unit; applies to each row when rows is set |
rows |
number | — | Number of skeleton rows stacked within the given height |
sheen |
boolean | false |
Adds an animated horizontal shimmer effect |
Slots
None.
Events
None.
For AI agents:
- Always include CSS units in
width,height, andborderRadiusvalues (e.g.,"200px"not"200"). - Use
borderRadius="50%"with equalwidthandheightfor circular skeletons (avatars, icons). - Use
rowswhen representing a block of text lines — pair it with aheightthat spans all rows. sheenis optional; omit it for a static placeholder, add it for an animated loading effect.- There are no slots, events, or public methods on this component.
- Match skeleton dimensions as closely as possible to the real content to prevent layout shift when content loads.
Weekly Installs
1
Repository
govtechsg/sgds-…omponentGitHub Stars
12
First Seen
5 days ago
Security Audits
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1