import { Skeleton } from 'sud-ui';데이터를 불러오는 동안 화면 구조를 먼저 보여 줄 때
로딩 후 레이아웃이 크게 흔들리지 않게 하고 싶을 때
import { Skeleton } from "sud-ui";
export default function Example() {
return <Skeleton />;
}import { Skeleton } from "sud-ui";
export default function Example() {
return (
<Skeleton
active
avatar
round
paragraph={{ rows: 2, width: ["90%", "70%"] }}
/>
);
}import { Skeleton } from "sud-ui";
export default function Example() {
return <Skeleton active paragraph={{ rows: 2 }} />;
}import { useState } from "react";
import { Skeleton, Switch, Typography } from "sud-ui";
export default function Example() {
const [loading, setLoading] = useState(true);
return (
<>
<Switch checked={loading} onChange={setLoading} ariaLabel="loading" />
<Skeleton active loading={loading} avatar>
<Typography>Soon UI Design</Typography>
</Skeleton>
</>
);
}속성 이름 | 설명 | 타입 | 기본값 |
|---|
| loading | false면 children을 보여 줍니다 | boolean | true |
| active | 반짝이는 애니메이션 | boolean | false |
| avatar | 아바타 자리 표시 (크기와 모양 지정 가능) | boolean | { size?: number | string; shape?: "circle" | "square" } | false |
| title | 제목 줄 | boolean | { width?: number | string } | true |
| paragraph | 문단 줄 수와 너비 | boolean | { rows?: number; width?: number | string | (number | string)[] } | 3줄 (아바타가 있으면 2줄) |
| round | 둥근 막대 | boolean | false |
| baseColor | 막대 기본 색상 | string | neutral-2 |
| highlightColor | 반짝임 색상 | string | neutral-3 |
| ariaLabel | 스크린리더에 읽히는 로딩 이름 | string | Loading |
| className / style | 추가 클래스와 스타일 | string / CSSProperties | - |