skeleton-usage

Apply @techsio/ui-kit Skeleton components to preserve layout during content loading.

2|Updated Dec 2, 2024
One-click install
npx skills add https://github.com/TechsioCZ/new-engine --skill skeleton-usage
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: skeleton-usage
Source: https://github.com/TechsioCZ/new-engine/tree/main/libs/ui/skills/skeleton-usage
Command: npx skills add https://github.com/TechsioCZ/new-engine --skill skeleton-usage

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps UI preserve layout by displaying skeleton placeholders during data loading, preventing layout shifts and improving perceived performance.

Core Features & Use Cases

  • Mirror final content structure with Skeleton components (Skeleton, Skeleton.Text, Skeleton.Circle, Skeleton.Rectangle) to represent loading placeholders.
  • Seamless integration with @techsio/ui-kit to cover text lines, avatars, and media areas during asynchronous fetches.
  • Use cases include loading product lists, profile cards, and dashboards where content is revealed upon completion.

Quick Start

Wrap your content in Skeleton and render a Skeleton.Text as a placeholder while data loads.

Frequently Asked Questions about skeleton-usage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent layout shifts during data loading in React?

Skeleton loading placeholders preserve layout stability by mirroring final content dimensions during data fetches. They reserve exact space for text lines, avatars, and media in React components, ensuring the layout remains stable and preventing visual jumps.

What is the best way to show loading states for profile cards and dashboards?

The best way to show loading states for profile cards and dashboards is using skeleton placeholders. By wrapping content in Skeleton components, you display structured loading states for text lines and media areas, which are revealed seamlessly upon fetch completion.

How do I implement skeleton loading placeholders using @techsio/ui-kit?

Implement skeleton loading placeholders by wrapping your content in the @techsio/ui-kit Skeleton component. Use Skeleton.Text, Skeleton.Circle, and Skeleton.Rectangle to represent loading areas, configuring the isLoaded, variant, and speed props in your TSX files.

Does the @techsio/ui-kit skeleton component support circular avatars and text lines?

Yes, the @techsio/ui-kit skeleton component supports circular avatars and text lines. It provides specific Skeleton.Circle and Skeleton.Text variants designed to accurately represent and reserve space for avatars and text while data fetches complete.

Can I customize the animation speed of skeleton placeholders in my frontend design system?

Yes, you can customize the animation speed of skeleton placeholders in your frontend design system. The @techsio/ui-kit Skeleton component accepts a speed prop, allowing you to control the animation timing alongside the variant and isLoaded props.

When should I not use skeleton loading placeholders in frontend components?

You should avoid skeleton loading placeholders when content loads instantly or when the final layout structure is completely unknown. Skeletons require anticipating the final content dimensions to prevent layout shifts, making them ineffective for highly dynamic or unpredictable content structures.