Skeleton
Skeletonは、コンテンツ読み込み中にプレースホルダーを表示するコンポーネントです。 実際のレイアウト構造を事前に提示することで、レイアウトシフトを防ぎ、体感速度を向上させます。
3
Variants
2
Animations
Count
Multi-line
Pure
React
Playground
Preview
text × 3pulse
Variant
Animation
Count
<Skeleton count={3} />Variants
Text
テキスト行のプレースホルダー。角丸+行高さ比例サイズ
Circular
アバター・アイコン用の円形プレースホルダー
Rectangular
画像・カード領域の矩形プレースホルダー
Features
Animation
2種のアニメーション。pulseは明暗パルス、waveは左→右のシマーエフェクト。
pulse
wave
false (static)
Composition
複数のSkeletonを組み合わせてカード・リストなど複雑なレイアウトを再現できます。
Count
countでテキスト行を自動生成。最終行は短く、各行は自然な幅バリエーションが付きます。
count={3}
count={5} animation="wave"
Loading Wrapper
loading propで条件付き描画。trueでSkeleton表示、falseでchildrenを描画します。
loading=true
JH
loading=falseCustom Sizing
width・height・radius propで精密なサイジングが可能です。
API
Component Structure
Skeleton— Pure Reactスタンドアロンコンポーネント。サブコンポーネントはありません。
Props
variant"text""text" | "circular" | "rectangular"形状バリアント(text: 角丸行、circular: 円形、rectangular: 矩形)
animation"pulse""pulse" | "wave" | falseアニメーション(pulse: 明暗パルス、wave: シマー、false: 静的)
countundefinednumberテキスト行数(text variant のみ。自動幅バリエーション付き)
loadingundefinedboolean条件付きローディング(true: Skeleton表示、false: children描画)
widthundefinedstring | numberカスタム幅
heightundefinedstring | numberカスタム高さ
radiusundefinedstring | numberカスタムborder-radius
childrenundefinedReactNodeloading=false 時に描画するコンテンツ
classNameundefinedstring追加のCSSクラス
| Name | Type | Default | Description |
|---|---|---|---|
variant | "text" | "circular" | "rectangular" | "text" | 形状バリアント(text: 角丸行、circular: 円形、rectangular: 矩形) |
animation | "pulse" | "wave" | false | "pulse" | アニメーション(pulse: 明暗パルス、wave: シマー、false: 静的) |
count | number | undefined | テキスト行数(text variant のみ。自動幅バリエーション付き) |
loading | boolean | undefined | 条件付きローディング(true: Skeleton表示、false: children描画) |
width | string | number | undefined | カスタム幅 |
height | string | number | undefined | カスタム高さ |
radius | string | number | undefined | カスタムborder-radius |
children | ReactNode | undefined | loading=false 時に描画するコンテンツ |
className | string | undefined | 追加のCSSクラス |