Skip to content
Cojeev UI

Skeleton

Feedback

Reserves the visual shape of content while its real data is still loading.

React · copy into your project · light and dark themes

Try it

Loading preview…

Take it with you

Copy the example, API and usage notes for your editor or AI assistant.

Add to your project

Terminal
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/skeleton.json

The command includes the component’s shared dependencies. Your project keeps editable source files.

Include the complete example

This example also composes button, input, field. Install its parts together:

Terminal
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/button.json https://luv-jeri.github.io/cojeev-ui/r/skeleton.json https://luv-jeri.github.io/cojeev-ui/r/input.json https://luv-jeri.github.io/cojeev-ui/r/field.json

Using skeleton

  • Choose skeleton shapes and groups that approximate the content that will replace them.

  • Replace placeholders with the completed content or a useful error state when loading finishes.

  • AsyncContent accepts optional loading and fallback props. The real content stays mounted across loading changes so input edits survive; omitted loading preserves the original static wrapper.

API

Compose the exported parts below. The prop types are read from the React source during the registry build.

Native element or underlying primitive props are inherited where declared, including accessible labels, event handlers and refs.

SkeletonProps

PropTypeRequired
variant"line" | "default" | "pill" | "card" | "disk" | "skel-group" | null | undefinedNo
size"default" | null | undefinedNo
asReact.ElementTypeNo

SkeletonGroupProps

PropTypeRequired
variant"default" | null | undefinedNo
size"default" | null | undefinedNo
asReact.ElementTypeNo

AsyncContentProps

PropTypeRequired
variant"default" | null | undefinedNo
size"default" | null | undefinedNo
asReact.ElementTypeNo
loading

Caller-owned loading state. Omit to preserve the static composition.

booleanNo
fallbackReact.ReactNodeNo

AsyncRowProps

PropTypeRequired
variant"default" | null | undefinedNo
size"default" | null | undefinedNo
asReact.ElementTypeNo

QuietProps

PropTypeRequired
variant"default" | null | undefinedNo
size"default" | null | undefinedNo
asReact.ElementTypeNo

Accessibility

  • Hide decorative placeholders from assistive technology and expose the loading state once on the surrounding content region.

States and appearance

rest

For conditional content, keep a MotionPresence boundary around keyed MotionSurface children. The shared entrance and exit states work with native primitives and respect your motion preference.

Try pointer and keyboard interaction, and switch the appearance control in the navigation to compare light and dark mode. Motion respects reduced motion preferences.