Installation
Section titled “Installation”- Package
@bigbang/ui- Import
import { Skeleton } from '@bigbang/ui';- Source
- Skeleton.tsx
- Storybook
- Skeleton · Playground
Skeleton is in the @bigbang/ui package.
import { Skeleton } from '@bigbang/ui';
<Skeleton lines={2} loading={isLoading}> <p>Card description goes here.</p></Skeleton>;shape- Description
- Shape of the placeholder: lines of text, a block for media or cards, or a circle for an avatar.
- Type
'block' | 'circle' | 'text'- Default
'text'
lines- Description
- Number of text lines; the last of several is shorter.
- Type
number- Default
1
width- Description
- Inline size as a CSS length, such as
'12rem'or'50%'. The default fills the width; a circle is 32 px. - Type
string
height- Description
- Block size of a block or circle as a CSS length. A block without it keeps a 16:9 ratio.
- Type
string
loading- Description
- While true, the placeholder shows; when false,
childrenreplace it and fade in. - Type
boolean- Default
true
label- Description
- What is loading, read by screen readers. Without it, the library string
ui.skeleton.loadingis read ("İçerik yükleniyor" or "Loading content"). - Type
string
decorative- Description
- Hides the placeholder from assistive technology, when a parent already reports the loading state.
- Type
boolean- Default
false
className- Description
- For layout only: margins and placement.
- Type
string
children- Description
- The real content, shown when
loadingis false. - Type
ReactNode
Data attributes
Section titled “Data attributes”data-component="skeleton": on the root element.data-state:loadingorloaded.data-part:line,block,circle.