본문으로 건너뛰기
피드백 / skeleton

Skeleton

콘텐츠 도착 전 자리를 차지하는 placeholder — shimmer 로딩 시각.
피드백skeletonInteractiveskeleton스켈레톤placeholderloading
01 · Specimen

먼저 보고, 그다음 계약을 읽습니다

콘텐츠 도착 전 자리를 차지하는 placeholder — shimmer 로딩 시각.

Workbench 불러오는 중…
Component intent의도와 경계 읽기

LLM 스트리밍 응답·표·카드·메시지가 도착하기 전 그 자리를 미리 점유해 layout shift 를 막는다. variant 로 모양(text=1em 라인 / circle=정원 아바타 / rect=기본 카드·이미지)을 고르고, width/height 로 크기를 지정한다(number 는 px 자동 변환, string 은 그대로). shimmer 는 ::after transform sweep(compositor-only)이며 aria-hidden 이라 스크린리더에 노출되지 않는다. ToolCallCard 의 pending 자리 동반 시각.

02 · Use

예제

SSOT에 등록된 실제 API 기준 snippet입니다. standalone 배지만 독립 실행 단위이며, fragment는 주변 state·handler 문맥을 생략합니다.

01텍스트 라인 여러 줄tsxfragment
텍스트 라인 여러 줄
import { Skeleton } from "@axe/ui";export function Example() {  return (    <>      <Skeleton variant="text" width="80%" />      <Skeleton variant="text" width="60%" />    </>  );}
02아바타 + 카드 자리tsxfragment
아바타 + 카드 자리
import { Skeleton } from "@axe/ui";export function Example() {  return (    <>      <Skeleton variant="circle" width={40} />      <Skeleton variant="rect" width="100%" height={120} />    </>  );}
03CSS-only (비-React)htmlfragment
CSS-only (비-React)
<div class="axe-skeleton axe-skeleton--text" role="presentation"     aria-hidden="true" style="width: 80%"></div><div class="axe-skeleton axe-skeleton--circle" role="presentation"     aria-hidden="true" style="width: 40px"></div>
03 · React

Props

TSX 소스가 진실입니다. 주요 export 컴포넌트의 public API만 노출합니다.

이름타입필수기본값설명
variant"text" | "circle" | "rect""rect"모양. text=1em 라인(radius-sm) · circle=정원(aspect 1/1) · rect=기본 사각.
widthnumber | string너비. number 면 px 로 변환, string 이면 그대로(예 "60%"). 인라인 style 로 적용.
heightnumber | string높이. number 면 px, string 이면 그대로. text variant 는 미지정 시 1em.
...restReact.HTMLAttributes<HTMLDivElement>className 병합, style 은 width/height 뒤에 전개되어 덮어쓸 수 있고, 나머지는 루트 div 로 전파.
04 · Any stack

.axe-* 클래스 계약

React 밖에서도 같은 표면을 그리는 공개 계약입니다. stable은 minor 버전 안에서 이름을 바꾸지 않습니다.

클래스안정성용도
.axe-skeletonstable루트 div — subtle 배경·radius-md·overflow hidden, ::after shimmer sweep.
.axe-skeleton--textstabletext 변형 — height 1em·radius-sm(라인 모양).
.axe-skeleton--circlestablecircle 변형 — 완전 원(radius 9999·aspect 1/1).
.axe-skeleton--rectstablerect 변형(기본) — 별도 규칙 없는 마커, width/height 로 크기 지정.
비-React 소비 노트
순수 CSS 로 재현 가능 — .axe-skeleton + variant 클래스에 인라인 width/height, role="presentation" aria-hidden="true" 를 직접 부여한다. 스타일(indicators.css)은 components.css 가 @import 하므로 별도 로드 불요.
05 · Inclusive

접근성

키보드, ARIA, 구현 노트를 함께 검토합니다.

ARIA

루트에 role="presentation" + aria-hidden="true" 고정 — placeholder 는 스크린리더가 무시한다(로딩 노이즈 방지).

Notes

로딩 자체를 SR 에 알리려면 상위 컨테이너에 aria-busy 또는 별도 상태 통지(status/live region)를 둔다. prefers-reduced-motion 시 ::after shimmer(content:none)가 꺼지고 정적 회색만 남는다.

06 · Judgment

권장 · 지양

권장
  • 실제 콘텐츠와 비슷한 폭/높이로 잡아 layout shift 를 없앤다.
  • text 라인은 폭을 조금씩 다르게 줘 실제 텍스트처럼 보이게 한다.
지양
  • 장식용 무한 shimmer 로 남겨두지 말 것 — 콘텐츠가 오면 즉시 교체.
  • 정보 전달용 요소를 skeleton 으로 대체하지 말 것(aria-hidden 이라 SR 에 안 읽힌다).
검색창을 열면 컴포넌트 인덱스를 불러옵니다.