@atlaskit/inline-message
추가 정보, 경고, 오류, 또는 확인을 위한 인라인(in-context) 알림 컴포넌트예요.
출처: 문서
본문
InlineMessage 컴포넌트
추가 정보, 경고, 오류, 또는 확인을 위한 인라인(in-context) 알림이에요.
- Keywords: message, inline, feedback, status, alert
- Categories: feedback
- Status: general-availability
예시
import InlineMessage from '@atlaskit/inline-message/inline-message';
const Examples = (): React.JSX.Element => (
<>
<InlineMessage
title="Success"
secondaryText="Your changes have been saved successfully."
appearance="confirmation"
/>
<InlineMessage
title="Warning"
secondaryText="This action cannot be undone."
appearance="warning"
/>
<InlineMessage
title="Error"
secondaryText="Something went wrong. Please try again."
appearance="error"
/>
</>
);
export default Examples;
Props
| Prop | Type | Description |
|---|---|---|
appearance |
"warning" | "error" | "info" | "connectivity" | "confirmation" |
Set the icon to be used before the title |
children |
string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.ReactPortal |
The elements to be displayed by the popup |
iconLabel |
string |
Text to be used as the label for the button icon |
placement |
AutoPlacement | BasePlacement | VariationPlacement |
The placement to be passed to the popup |
secondaryText |
string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.ReactPortal |
Text to display second |
spacing |
"compact" | "spacious" |
The spacing of the underlying icon button |
title |
string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.ReactPortal |
Text to display first, bolded for emphasis |
사용 지침
- 인라인 알림에 사용해요: 추가 정보, 경고, 오류, 확인.
- 아이콘/타이틀/보조 텍스트를 사용해 맥락이나 링크가 있는 팝업에서 전체 메시지를 드러낼 수 있어요.
- 콘텐츠를 최대 다섯 줄로 유지해요(잘림은 접근성이 떨어져요).
- 최소한의 상호작용에는 Flag를, 중요/시스템에는 Banner를, 즉각적인 조치가 필요할 때는 Modal을 사용해요.
콘텐츠 지침
- 명확하고 간결한 메시지 텍스트를 사용해요.
- 구체적이고 실행 가능한 피드백을 제공해요.
- 메시지 유형에 맞는 어조를 사용해요.
- 메시지를 집중적이고 관련성 있게 유지해요.
- 경고: 조치 전에, 공감하고, 대안을 제시해요.
- 오류: 설명하고 다음 단계를 제시해요. "너"가 아니라 "우리"를 사용해요.
- 확인: 확인한 뒤, 사용자를 방해하지 마요.
- 정보: 알려주되, 조치는 필요 없어요.
- 명확하고 간결한 메시지 텍스트를 사용하고, 집중적이고 관련성 있게 유지해요.
접근성 지침
- 최대 다섯 줄로 유지해요. 잘림은 접근성이 떨어져요.
- 타이틀을 권장해요. 아이콘만 있는 것은 스크린 리더가 놓치기 쉬워요.
- 타이틀이 없거나 아이콘이 맥락을 추가할 때(예: 오류)
iconLabel을 사용해요. - 메시지 콘텐츠가 스크린 리더에 안내되도록 해요.
- 적절한 메시지 유형과 색상을 사용해요.