빈 상태
빈 상태 (Empty State)
빈 상태 컴포넌트는 표시할 내용이 없을 때(할 일 없음, 정리된 받은 편지함, 검색 결과 없음) 보여주는 컴포넌트예요.
출처: 문서
본문
EmptyState 컴포넌트
표시할 내용이 없을 때(할 일 없음, 정리된 받은 편지함, 결과 없음) 사용하는 컴포넌트예요.
- Keywords: empty, state, results, placeholder, no-content, void
- Categories: status
- Status: general-availability
예시
import EmptyState from '@atlaskit/empty-state/empty-state';
const Examples = (): React.JSX.Element => (
<>
<EmptyState header="No items" description="Add items to get started" />
<EmptyState
header="No search results"
description="Try adjusting your search criteria or browse all items."
/>
<EmptyState
header="Welcome to your dashboard"
description="Create your first project to get started with the platform."
/>
</>
);
export default Examples;
Props
| Prop | Type | Description |
|---|---|---|
buttonGroupLabel |
string |
Accessible name for the action buttons group of empty state |
description |
string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
The main block of text that holds additional supporting information |
header |
string |
Title that briefly describes the page to the user (required) |
headingLevel |
number |
The value used to set the heading level of the header element |
headingSize |
"xsmall" | "medium" |
The keyword used to set the visual appearance of the header element |
imageHeight |
number |
Height of the image that is rendered in EmptyState component |
imageUrl |
string |
The url of image that will be shown above the title, fed directly into the src prop of an |
imageWidth |
number |
Width of the image that is rendered in EmptyState component |
isLoading |
boolean |
Used to indicate a loading state |
maxImageHeight |
number |
Maximum height (in pixels) of the image, default value is 160 |
maxImageWidth |
number |
Maximum width (in pixels) of the image, default value is 160 |
primaryAction |
string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
Primary action button for the page, usually it will be something like "Create" (or "Retry" for error pages) |
renderImage |
(props: RenderImageProps) => React.ReactNode |
An alternative API to supply an image using a render prop |
secondaryAction |
string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
Secondary action button for the page |
tertiaryAction |
string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
Button with link to some external resource like documentation or tutorial, it will be opened in a new tab |
width |
"narrow" | "wide" |
Controls how much horizontal space the component fills |
사용 지침
- 보기에 표시할 내용이 없을 때(할 일 없음, 결과 없음, 정리된 받은 편지함) 사용해요
- 헤더는 필수이고, 일러스트레이션·설명·버튼은 선택이에요
- 상황에 맞게 wide(464px) 또는 narrow(304px) 레이아웃을 사용해요
- 기본 CTA는 하나만 제공하고, 기본 버튼을 여러 개 쌓지 마세요
- 일러스트레이션은 포인트(spot)로만 사용하고 크기를 조절하지 마세요. 관련성 있고 중립적이거나 유머러스하게 유지해요
- 상태가 왜 비어 있는지 설명하고 명확한 다음 단계를 제공해요
- 일러스트레이션의 i18n을 고려해요(예: 문화적으로 중립적인 이미지, 번역 가능한 alt 텍스트)
콘텐츠 지침
- 새로 시작(blank slate): 영감을 주고 동기를 부여하는 톤이에요
- 모두 완료(all done): 축하하는 톤이에요
- 결과 없음(no results): 다음 단계가 있는 중립적인 톤이에요
- 명확하고 설명적인 헤더를 사용해요
- 구체적인 다음 단계를 제공하고 부정적인 표현은 피해요
접근성 지침
- 전문 용어를 피하고 쉬운 언어를 사용해요
- 설명적인 링크 텍스트를 사용해요("click here" 금지)
- 일러스트레이션이 의미가 있을 때만 alt 텍스트를 추가하고, 그렇지 않으면 생략하거나 장식용으로 표시해요
- 명확한 빈 상태 메시지를 제공해요
- 적절한 제목과 구조를 사용해요
- 실행 가능한 콘텐츠가 접근 가능하도록 해요