@atlaskit/visually-hidden
시각적으로는 숨겨져 있지만 스크린 리더에는 제공되는 콘텐츠예요. 의미가 시각적으로는 명확하지만 보조 기술에는 그렇지 않을 때 사용해요.
출처: 문서
본문
VisuallyHidden 컴포넌트
시각적으로는 숨겨져 있지만 스크린 리더에는 제공되는 콘텐츠예요. 의미가 시각적으로는 명확하지만 보조 기술에는 그렇지 않을 때 사용해요.
- Keywords: hidden, accessibility, screen-reader, aria, utility
- Categories: utility
- Status: general-availability
예시
import VisuallyHidden from '@atlaskit/visually-hidden/visually-hidden';
export default (): React.JSX.Element => {
return (
<div style={{ border: '1px solid black' }}>
There is text hidden between the brackets [<VisuallyHidden>Can't see me!</VisuallyHidden>]
</div>
);
};
Props
| Prop | Type | Description |
|---|---|---|
children |
string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
The element or elements that should be hidden (required) |
id |
string |
An id may be appropriate for this component if used in conjunction with aria-describedby |
| on a paired element | ||
role |
string |
An ARIA role attribute to aid screen readers |
사용 지침
- 의미가 시각적으로는 명확하지만 보조 기술에는 그렇지 않을 때 사용해요.
- 어수선함을 피해요—장황한 스크린 리더 전용 텍스트는 도움보다 해로울 수 있어요.
- 필요할 때 의미를 위해 role prop을 사용해요.
콘텐츠 지침
- 명확하고 설명적인 숨겨진 콘텐츠를 사용해요.
- 콘텐츠가 스크린 리더에 가치를 더하도록 보장해요.
- 콘텐츠를 간결하되 의미 있게 유지해요.
접근성 지침
- 보조 기술에 시각적 맥락이 충분하지 않을 때 스크린 리더 전용 콘텐츠에 사용해요.
- 적절할 때 의미를 위해 role prop을 사용해요.
- 명확성과 간결성의 균형을 맞춰요—스크린 리더 사용자를 압도하지 마요.
- 스크린 리더가 전체 구절을 번역하거나 안내해야 하는 경우, 어떤 상황에서는 aria-label보다 이것을 선호해요.