Skip to main content

lib-skeleton-loader

lib-skeleton-loader is the shared loading placeholder. It is heavily reused because it gives screens a decent loading state without each feature hand-rolling its own shimmer layout.

Import

import { SkeletonLoaderComponent } from '@shared-lib/components/skeleton-loader/skeleton-loader.component';

Variants

VariantBest for
detaildetail page, dialog body, single card
gridcard galleries
liststacked rows or message-like items
tabledata tables

Inputs

InputTypeDefaultNotes
variant'detail' | 'grid' | 'list' | 'table''detail'Main layout
showHeaderbooleantrueHeader placeholder
showActionsbooleantrueAction buttons or row pill
cardsnumber3Count for grid/list
linesnumber3Content line count
density'comfortable' | 'compact''comfortable'Spacing
animatebooleantrueShimmer on or off
shimmerMsnumber1200Shimmer speed input exists in API
roundnessnumber16Border radius
titlestringnoneOptional static loading title
tableRowsnumber6Table body rows
tableColsnumber5Table columns
showTableHeaderbooleantrueTable head placeholder

Common examples

Detail page:

<lib-skeleton-loader title="Loading your summaries..."></lib-skeleton-loader>

List-like content:

<lib-skeleton-loader
[showHeader]="false"
variant="list"
[showActions]="false"
/>

Dense table:

<lib-skeleton-loader
variant="table"
[showHeader]="false"
[tableRows]="8"
[tableCols]="4"
/>

Practical rules

  • Match the variant to the final layout so the page does not jump around too much.
  • Turn showHeader off when the parent page already has a real header.
  • Use compact density when the final UI is dense.
  • Keep the loading title short. It should reassure, not explain the whole feature.

Common pairing

This component often sits right next to lib-error-card:

  1. show skeleton while loading
  2. show error card if loading fails
  3. show real content when data arrives

That is one of the most common screen-state patterns in this repo.