ARIA 접근성 가이드

기본 개념

HTML 요소와 ARIA 매핑

대부분의 HTML 요소는 암묵적 역할을 가집니다. 요소별 기본 역할과, ARIA in HTML 명세가 정한 허용·금지 규칙, 중복 지정을 피하는 방법을 정리합니다.

암묵적 역할이란

암묵적 역할(implicit role)은 role 속성을 쓰지 않아도 HTML 요소가 기본으로 가지는 역할입니다. 예를 들어 <button>은 처음부터 button 역할을 가지고, <nav>는 navigation 랜드마크입니다. 이 대응 관계는 HTML-AAM이 브라우저 기준으로, ARIA in HTML이 작성자 기준으로 정합니다.

비권장암묵적 역할을 다시 지정 (불필요)
<nav role="navigation">
  <ul role="list">
    <li role="listitem"><a href="/" role="link">홈</a></li>
  </ul>
</nav>
권장HTML만으로 같은 접근성 트리
<nav>
  <ul>
    <li><a href="/">홈</a></li>
  </ul>
</nav>

일부 요소는 문맥에 따라 역할이 달라집니다. <header>와 <footer>는 페이지 전체에 속할 때만 banner, contentinfo 랜드마크가 되고, <article>이나 <section> 안에 있으면 generic이 됩니다. <section>은 이름(aria-label, aria-labelledby)이 있을 때만 region 랜드마크가 됩니다.

주요 요소의 암묵적 역할 표

아래 표는 ARIA in HTML 명세를 요약한 것입니다. “모든 역할”은 어떤 역할이든 지정할 수 있다는 뜻이고, “역할 지정 불가”는 role 속성을 쓰면 안 된다는 뜻입니다. “없음”은 대응하는 ARIA 역할이 없다는 뜻으로, 브라우저가 플랫폼 고유 역할로 노출하거나 노출하지 않습니다.

HTML 요소의 암묵적 역할과 허용 역할 (ARIA in HTML 기준, 요약)
HTML 요소암묵적 역할지정할 수 있는 역할
<a href>linkbutton checkbox menuitem menuitemcheckbox menuitemradio option radio switch tab treeitem
<a> (href 없음)generic모든 역할
<abbr>없음모든 역할
<address>group모든 역할
<area href>link역할 지정 불가
<article>articleapplication document feed main none presentation region
<aside>complementary (body·main 바로 아래이거나 이름이 있을 때. 그 밖의 경우 generic)feed none note presentation region search
<audio>, <video>없음application
<b>, <i>, <u>, <small>generic모든 역할
<blockquote>blockquote모든 역할
<body>generic역할 지정 불가
<br>없음none presentation
<button>buttoncheckbox combobox gridcell link menuitem menuitemcheckbox menuitemradio option radio separator slider switch tab treeitem
<caption>caption역할 지정 불가
<code>code모든 역할
<datalist>listbox역할 지정 불가
<dd>definition역할 지정 불가
<del>, <s>deletion모든 역할
<details>group역할 지정 불가
<dfn>term모든 역할
<dialog>dialogalertdialog
<div>generic모든 역할 (dl의 자식이면 none·presentation만)
<dl>없음group list none presentation
<dt>termlistitem
<em>emphasis모든 역할
<fieldset>groupnone presentation radiogroup
<figure>figurefigcaption이 없을 때 모든 역할
<footer>contentinfo (body 범위일 때. article·aside·main·nav·section 안이면 generic)group none presentation
<form>form (접근 가능한 이름이 있을 때 랜드마크로 노출)none presentation search
<h1> ~ <h6>heading + aria-levelnone presentation tab
<header>banner (body 범위일 때. 그 밖에는 generic)group none presentation
<hgroup>group모든 역할
<hr>separatornone presentation
<html>document역할 지정 불가
<iframe>없음application document img none presentation
<img alt="">presentationnone presentation
<img alt="텍스트">imgbutton checkbox link menuitem menuitemcheckbox menuitemradio meter option progressbar radio scrollbar separator slider switch tab treeitem
<input type="button|submit|reset|image">button제한적 (type에 따라 다름)
<input type="checkbox">checkboxmenuitemcheckbox option switch, button (aria-pressed와 함께)
<input type="radio">radiomenuitemradio
<input type="text"> (list 없음)textboxcombobox searchbox spinbutton
<input type="email|tel|url"> (list 없음)textbox역할 지정 불가
<input type="search"> (list 없음)searchbox역할 지정 불가
<input list="…"> (text·search·email·tel·url)combobox역할 지정 불가
<input type="number">spinbutton역할 지정 불가
<input type="range">slider역할 지정 불가
<input type="password">없음역할 지정 불가
<ins>insertion모든 역할
<label>, <legend>없음역할 지정 불가
<li>listitem (ol·ul·menu의 자식일 때)모든 역할
<main>main역할 지정 불가
<math>math역할 지정 불가
<menu>, <ol>, <ul>listgroup listbox menu menubar none presentation radiogroup tablist toolbar tree
<meter>meter역할 지정 불가
<nav>navigationmenu menubar none presentation tablist
<optgroup>group역할 지정 불가
<option>option역할 지정 불가
<output>status모든 역할
<p>paragraph모든 역할
<pre>generic모든 역할
<progress>progressbar역할 지정 불가
<search>searchform group none presentation region
<section>region (접근 가능한 이름이 있을 때. 없으면 generic)여러 랜드마크·창·라이브 리전 역할 등
<select> (multiple·size 없음)comboboxmenu
<select multiple> 또는 size &gt; 1listbox역할 지정 불가
<span>generic모든 역할
<strong>strong모든 역할
<sub>, <sup>subscript / superscript모든 역할
<summary>없음 (브라우저는 보통 펼침 버튼처럼 노출)역할 지정 불가
<svg>graphics-document모든 역할
<table>table모든 역할
<thead>, <tbody>, <tfoot>rowgroup모든 역할
<tr>row모든 역할
<td>cell (grid·treegrid 안이면 gridcell)모든 역할
<th>columnheader / rowheader (위치·scope에 따라)모든 역할
<textarea>textbox (aria-multiline="true")역할 지정 불가
<time>time모든 역할

표를 읽을 때

DPub-ARIA(doc-*) 역할과 일부 세부 조건은 생략했습니다. 허용 역할이 “모든 역할”이라도 규칙 2에 따라 꼭 필요할 때만 바꾸세요. 최신·전체 목록은 ARIA in HTML 원문을 확인하세요.

허용되는 역할과 금지되는 역할

ARIA in HTML은 요소마다 지정할 수 있는 역할을 제한합니다. 원래 의미와 동작이 너무 다른 역할로 바꾸면 사용자 기대와 실제 동작이 어긋나기 때문입니다.

비권장허용되지 않는 역할
<button role="heading">공지사항</button>
<input type="checkbox" role="button">
<main role="navigation">…</main>
<label role="button">파일 선택</label>
권장허용 목록 안의 역할 또는 알맞은 요소
<button role="tab" aria-selected="true">공지사항</button>
<input type="checkbox" role="switch">
<nav aria-label="주 메뉴">…</nav>
<button type="button">파일 선택</button>
  • <main>, <label>, <input type="number">, <textarea>, <select multiple>, <progress>처럼 역할을 지정할 수 없는 요소가 있습니다.
  • <input type="checkbox">에는 switch, menuitemcheckbox, option처럼 의미가 가까운 역할만 허용됩니다.
  • <img alt="">는 장식 이미지로 간주되어 none / presentation 외의 역할을 쓸 수 없습니다.

중복 지정 금지

ARIA in HTML은 작성자가 암묵적 의미와 같은 role이나 aria-* 값을 다시 지정하지 말라고 권고합니다. 명세 예시는 <button role="button">을 “피해야 할 코드”로 듭니다. 중복 지정은 동작상 큰 문제는 없지만 코드를 읽기 어렵게 하고, 요소를 바꿀 때 잘못된 역할이 남는 원인이 됩니다.

비권장중복 지정
<button role="button">저장</button>
<h2 role="heading" aria-level="2">공지</h2>
<input type="text" aria-required="true" required>
<main role="main">…</main>
권장네이티브 의미만 사용
<button>저장</button>
<h2>공지</h2>
<input type="text" required>
<main>…</main>

예외: 오래된 브라우저 대응

과거에는 <main role="main">처럼 HTML5 요소를 지원하지 않는 브라우저를 위해 역할을 함께 쓰기도 했습니다. 현재 주요 브라우저는 모두 HTML 랜드마크 요소를 지원하므로 필요하지 않습니다. 단, CSS list-style: none을 적용한 목록을 Safari가 목록으로 노출하지 않는 문제 때문에 <ul role="list">를 쓰는 경우는 실무에서 흔히 허용됩니다.

네이티브 속성과 ARIA 속성의 충돌

HTML에 이미 같은 기능의 속성이 있으면 네이티브 속성을 씁니다. 두 가지를 함께 쓰면서 값이 다르면 보조기술이 엇갈린 정보를 받습니다. ARIA in HTML은 <input type="checkbox">에 aria-checked를 쓰는 것을 금지합니다.

비권장네이티브 상태와 충돌
<input type="checkbox" checked aria-checked="false">
<button disabled aria-disabled="false">전송</button>
<input type="text" required aria-required="false">
권장네이티브 속성만 사용
<input type="checkbox" checked>
<button disabled>전송</button>
<input type="text" required>
네이티브 속성과 ARIA 속성의 충돌
ARIA 속성먼저 쓸 HTML 속성
aria-checkedchecked (체크박스·라디오)
aria-disableddisabled
aria-requiredrequired
aria-readonlyreadonly
aria-hiddenhidden (화면과 보조기술 모두에서 숨길 때)
aria-placeholderplaceholder
aria-valuemin / aria-valuemax / aria-valuenowmin / max / value
aria-colspan / aria-rowspancolspan / rowspan
aria-multiselectablemultiple (<select>)

aria-disabled가 더 나은 경우

disabled 버튼은 포커스를 받지 못해 화면낭독기 사용자가 존재를 알기 어렵습니다. 비활성 이유를 알려야 하거나 포커스를 유지해야 할 때는 disabled 대신 aria-disabled="true"를 쓰고, 클릭 동작을 스크립트로 막는 방법도 씁니다. 이때는 두 속성을 함께 쓰지 않습니다.

이름을 붙일 수 없는 요소

generic 역할로 노출되는 <div>, <span>처럼 이름이 금지된(naming prohibited) 요소에는 aria-label과 aria-labelledby를 쓰면 안 됩니다. 브라우저·화면낭독기에 따라 무시되거나 일관되지 않게 읽힙니다. paragraph, code, strong, emphasis, presentation, none 등도 이름이 금지된 역할입니다.

비권장generic 요소에 이름
<div aria-label="공지 영역">…</div>
<span aria-label="필수">*</span>
권장알맞은 역할 사용 또는 숨김 텍스트
<section aria-label="공지">…</section>
<span aria-hidden="true">*</span><span class="sr-only">필수</span>

매핑 확인 방법

  • 브라우저 개발자 도구 접근성 패널에서 계산된 역할을 확인합니다(접근성 트리 보기).
  • Nu HTML Checker는 ARIA in HTML 규칙 위반(허용되지 않는 역할, 중복 역할)을 경고합니다.
  • axe 같은 자동 검사 도구로 aria-allowed-role, aria-prohibited-attr 규칙 위반을 찾을 수 있습니다(검사 도구).