탐색

v2.1.0
애플리케이션 블록

테이블 뷰

검색, 필터, 행 선택, 페이지 탐색을 갖춘 표입니다.

테이블 뷰에는 표를 사용하는 데 필요한 제목과 기본 작업, 필터와 정렬, 행 선택, 행별 작업, 페이지 탐색이 들어갑니다. 각각은 별도의 컴포넌트이며, 블록은 이들을 하나의 시트에 배치하는 방법을 보여 줍니다.

테이블 뷰

<section class="sheet container-inline flex flex-col overflow-hidden" data-example="table-view" aria-labelledby="tv-title">  <header class="flex flex-wrap items-center justify-between gap-sm p-md">    <div class="flex flex-col gap-3xs">      <h2 class="heading heading-sm" id="tv-title">Atlas Labs</h2>      <p class="m(0) fg-text-muted" id="tv-summary">24 projects</p>    </div>    <div class="flex flex-wrap items-center gap-xs">      <div class="segmented segmented-sm" role="radiogroup" aria-label="Show">        <label class="segmented-item">          <input type="radio" class="segmented-input" name="tv-set" value="projects" checked>Projects</label>        <label class="segmented-item">          <input type="radio" class="segmented-input" name="tv-set" value="people">People</label>        <label class="segmented-item">          <input type="radio" class="segmented-input" name="tv-set" value="files">Files</label>      </div>      <button type="button" class="btn btn-primary btn-sm" id="tv-action">        <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">          <path d="M3 8L13 8" />          <path d="M8 3L8 13" />        </svg>        <span>New project</span>      </button>    </div>  </header>  <div class="flex flex-wrap items-center gap-xs px-md pb-md">    <label class="input-group input-group-sm grow(1) basis(200) max-w(320)">      <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">        <circle cx="7" cy="7" r="4.5" />        <path d="M10.182 10.182L14 14" />      </svg>      <input class="input-group-field" type="search" id="tv-search" placeholder="Search projects" aria-label="Search projects" autocomplete="off">    </label>    <button type="button" class="btn btn-sm" popovertarget="tv-filters" data-filter="open">      <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">        <path d="M4.5365 3L11.4635 3A1 1 0 0 1 12.2548 4.6114L9.4587 8.2299A1 1 0 0 0 9.25 8.8413L9.25 11.323A1 1 0 0 1 8.6214 12.2514L7.875 12.55A0.8203 0.8203 0 0 1 6.75 11.7883L6.75 8.8413A1 1 0 0 0 6.5413 8.2299L3.7452 4.6114A1 1 0 0 1 4.5365 3Z" />      </svg>Filters      <span data-filter="count" aria-hidden="true" hidden>        <span class="badge badge-sm badge-ink badge-pill">0</span>      </span>    </button>    <select class="select select-raised select-sm ml-auto" id="tv-sort" aria-label="Sort by"></select>    <div class="w-full" data-filter="applied" hidden>      <div class="flex flex-wrap items-center gap-xs">        <ul class="flex flex-wrap gap-xs m(0) p(0)" aria-label="Applied filters" data-filter="chips"></ul>        <button type="button" class="btn btn-quiet btn-sm" data-filter="clear-all">Clear all</button>      </div>    </div>  </div>  <div class="popover p(0) w(560)" id="tv-filters" popover role="dialog" aria-labelledby="tv-filters-title" style="--popover-max-width: min(36rem, calc(100vw - 2rem))" data-filter="panel">    <form class="flex flex-col" data-filter="form" novalidate>      <header class="flex flex-col gap-3xs px-md pt-md pb-sm">        <h3 class="heading heading-xs" id="tv-filters-title">Filter projects</h3>        <p class="m(0) fg-text-muted" id="tv-filters-hint">A project shows when it meets every condition.</p>      </header>      <ul class="flex flex-col gap-xs m(0) px-md py-xs" data-filter="conditions"></ul>      <p class="m(0) px-md py-xs fg-text-muted" data-filter="empty">No conditions yet: every row shows.</p>      <p class="m(0) px-md py-xs fg-danger" id="tv-filters-error" role="alert" data-filter="error" hidden></p>      <div class="px-md pb-md">        <button type="button" class="btn btn-quiet btn-sm" data-filter="add">          <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">            <path d="M3 8L13 8" />            <path d="M8 3L8 13" />          </svg>Add condition</button>      </div>      <footer class="flex flex-wrap items-center justify-between gap-xs p-md bt(1) bt-solid b-line-hair">        <button type="button" class="btn btn-quiet btn-sm" data-filter="clear">Clear</button>        <div class="flex gap-xs">          <button type="button" class="btn btn-sm" data-filter="cancel">Cancel</button>          <button type="submit" class="btn btn-primary btn-sm">Apply</button>        </div>      </footer>    </form>  </div>  <div class="scroll-area scroll-area-inline bt(1) bt-solid b-line-hair">    <table class="table table-interactive" id="tv-table" aria-labelledby="tv-title">      <thead id="tv-head"></thead>      <tbody id="tv-body"></tbody>    </table>  </div>  <footer class="flex flex-wrap items-center justify-between gap-sm p-md bt(1) bt-solid b-line-hair">    <div class="flex flex-wrap items-center gap-xs min-h(32)">      <p class="m(0) fg-text-muted" id="tv-count">No projects selected</p>      <div id="tv-selected" hidden>        <div class="flex items-center gap-3xs">          <button type="button" class="btn btn-quiet btn-sm btn-danger" id="tv-delete">Delete</button>          <button type="button" class="btn btn-quiet btn-sm" id="tv-deselect">Clear selection</button>        </div>      </div>    </div>    <div class="flex flex-wrap items-center gap-sm">      <p class="m(0) fg-text-muted whitespace-nowrap" id="tv-range">1–8 of 24</p>      <nav aria-label="Pagination">        <ol class="pagination" id="tv-pages"></ol>      </nav>    </div>  </footer>  <p class="sr-only" role="status" id="tv-status"></p>  <template data-filter="row">    <li class="flex flex-wrap items-center gap-xs">      <span class="w(44) shrink(0) fg-text-muted text-end" data-part="joiner">Where</span>      <select class="select select-sm" aria-label="Field" data-part="field"></select>      <select class="select select-sm" aria-label="Comparison" data-part="operator"></select>      <input class="input input-sm grow(1) basis(128) min-w(0)" aria-label="Value" data-part="value" required>      <button type="button" class="btn btn-quiet btn-square btn-sm" aria-label="Remove condition" data-part="remove">        <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">          <path d="M4 4L12 12" />          <path d="M4 12L12 4" />        </svg>      </button>    </li>  </template>  <template data-filter="choice">    <select class="select select-sm grow(1) basis(128)" aria-label="Value" data-part="value"></select>  </template>  <template data-filter="chip">    <li>      <span class="chip">        <span class="chip-label"></span>        <button type="button" class="chip-remove" aria-label="Remove the filter">          <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">            <path d="M4 4L12 12" />            <path d="M4 12L12 4" />          </svg>        </button>      </span>    </li>  </template>  <template id="tv-head-projects">    <table class="table">      <thead>        <tr class="table-row">          <th class="table-heading" scope="col">            <input type="checkbox" class="checkbox" data-part="all" aria-label="Select all projects">          </th>          <th class="table-heading" scope="col" data-sort="name">Project</th>          <th class="table-heading" scope="col">Status</th>          <th class="table-heading" scope="col">Region</th>          <th class="table-heading table-numeric" scope="col" data-sort="deployments">Deployments</th>          <th class="table-heading" scope="col" data-sort="deployed">Last deployed</th>          <th class="table-heading" scope="col">            <span class="sr-only">Actions</span>          </th>        </tr>      </thead>    </table>  </template>  <template id="tv-row-projects">    <table class="table">      <tbody>        <tr class="table-row">          <td class="table-cell">            <input type="checkbox" class="checkbox" data-part="select" aria-label="Select">          </td>          <th class="table-cell table-primary" scope="row">            <span data-part="name"></span>            <span class="block fg-text-muted font-regular" data-part="domain"></span>          </th>          <td class="table-cell">            <span class="badge badge-dot" data-part="status"></span>          </td>          <td class="table-cell" data-part="region"></td>          <td class="table-cell table-numeric" data-part="deployments"></td>          <td class="table-cell whitespace-nowrap" data-part="deployed"></td>          <td class="table-cell text-end" data-part="actions"></td>        </tr>      </tbody>    </table>  </template>  <template id="tv-head-people">    <table class="table">      <thead>        <tr class="table-row">          <th class="table-heading" scope="col">            <input type="checkbox" class="checkbox" data-part="all" aria-label="Select all people">          </th>          <th class="table-heading" scope="col" data-sort="name">Person</th>          <th class="table-heading" scope="col">Role</th>          <th class="table-heading" scope="col">Status</th>          <th class="table-heading table-numeric" scope="col" data-sort="projects">Projects</th>          <th class="table-heading" scope="col" data-sort="active">Last active</th>          <th class="table-heading" scope="col">            <span class="sr-only">Actions</span>          </th>        </tr>      </thead>    </table>  </template>  <template id="tv-row-people">    <table class="table">      <tbody>        <tr class="table-row">          <td class="table-cell">            <input type="checkbox" class="checkbox" data-part="select" aria-label="Select">          </td>          <th class="table-cell table-primary" scope="row">            <span class="flex items-center gap-sm">              <span class="avatar avatar-sm" aria-hidden="true" data-part="initials"></span>              <span class="min-w(0)">                <span class="block" data-part="name"></span>                <span class="block fg-text-muted font-regular" data-part="email"></span>              </span>            </span>          </th>          <td class="table-cell" data-part="role"></td>          <td class="table-cell">            <span class="badge badge-dot" data-part="status"></span>          </td>          <td class="table-cell table-numeric" data-part="projects"></td>          <td class="table-cell whitespace-nowrap" data-part="active"></td>          <td class="table-cell text-end" data-part="actions"></td>        </tr>      </tbody>    </table>  </template>  <template id="tv-head-files">    <table class="table">      <thead>        <tr class="table-row">          <th class="table-heading" scope="col">            <input type="checkbox" class="checkbox" data-part="all" aria-label="Select all files">          </th>          <th class="table-heading" scope="col" data-sort="name">File</th>          <th class="table-heading" scope="col">Type</th>          <th class="table-heading table-numeric" scope="col" data-sort="size">Size</th>          <th class="table-heading" scope="col" data-sort="modified">Modified</th>          <th class="table-heading" scope="col">Owner</th>          <th class="table-heading" scope="col">            <span class="sr-only">Actions</span>          </th>        </tr>      </thead>    </table>  </template>  <template id="tv-row-files">    <table class="table">      <tbody>        <tr class="table-row">          <td class="table-cell">            <input type="checkbox" class="checkbox" data-part="select" aria-label="Select">          </td>          <th class="table-cell table-primary" scope="row">            <span class="flex items-center gap-sm">              <span class="icon-frame icon-frame-xs" aria-hidden="true">                <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">                  <path d="M4.5 2L9.0858 2A1 1 0 0 1 9.7929 2.2929L12.2071 4.7071A1 1 0 0 1 12.5 5.4142L12.5 13A1 1 0 0 1 11.5 14L4.5 14A1 1 0 0 1 3.5 13L3.5 3A1 1 0 0 1 4.5 2Z" />                  <path d="M10 2.5V4.4A0.1 0.1 0 0 0 10.1 4.5H12L12.2409 4.7427A0.9993 0.9993 0 0 1 12.5 5.4142V5.5H10.1Q9.6444 5.5 9.3222 5.1778Q9 4.8556 9 4.4V2A1.1002 1.1002 0 0 1 9.3761 2.0431A1.0001 1.0001 0 0 1 9.7929 2.2929L10 2.5Z" fill="currentColor" stroke="none" fill-rule="evenodd" />                </svg>              </span>              <span class="min-w(0) truncate" data-part="name"></span>            </span>          </th>          <td class="table-cell" data-part="type"></td>          <td class="table-cell table-numeric" data-part="size"></td>          <td class="table-cell whitespace-nowrap" data-part="modified"></td>          <td class="table-cell whitespace-nowrap" data-part="owner"></td>          <td class="table-cell text-end" data-part="actions"></td>        </tr>      </tbody>    </table>  </template>  <template id="tv-actions">    <div>      <button type="button" class="btn btn-quiet btn-square btn-sm" aria-label="Actions">        <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">          <circle cx="3.5" cy="8" r="1.05" fill="currentColor" stroke="none" />          <circle cx="8" cy="8" r="1.05" fill="currentColor" stroke="none" />          <circle cx="12.5" cy="8" r="1.05" fill="currentColor" stroke="none" />        </svg>      </button>      <div class="menu menu-end" popover>        <a class="menu-item" href="#" data-part="open">Open</a>        <hr class="menu-separator">        <button type="button" class="menu-item menu-item-danger" data-part="delete">Delete</button>      </div>    </div>  </template>  <template id="tv-empty">    <table class="table">      <tbody>        <tr class="table-row">          <td class="table-cell" colspan="7">            <div class="empty">              <p class="empty-title" data-part="title">No projects match</p>              <p class="empty-description">Try another search, or remove a filter.</p>              <div class="empty-actions">                <button type="button" class="btn btn-sm" data-part="reset">Clear the search and the filters</button>              </div>            </div>          </td>        </tr>      </tbody>    </table>  </template>  <template id="tv-page">    <ol class="pagination">      <li>        <button type="button" class="btn btn-quiet btn-square btn-sm" aria-label="Page"></button>      </li>    </ol>  </template>  <template id="tv-gap">    <ol class="pagination">      <li class="pagination-gap" aria-hidden="true">…</li>    </ol>  </template>  <template id="tv-previous">    <ol class="pagination">      <li>        <button type="button" class="btn btn-quiet btn-square btn-sm" aria-label="Previous page">          <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">            <path d="M6 3.5L10.3586 7.8586A0.2 0.2 0 0 1 10.3586 8.1414L6 12.5" transform="rotate(180 8 8)" />          </svg>        </button>      </li>    </ol>  </template>  <template id="tv-next">    <ol class="pagination">      <li>        <button type="button" class="btn btn-quiet btn-square btn-sm" aria-label="Next page">          <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">            <path d="M6 3.5L10.3586 7.8586A0.2 0.2 0 0 1 10.3586 8.1414L6 12.5" />          </svg>        </button>      </li>    </ol>  </template></section>
프로젝트를 검색, 필터링, 정렬하고 페이지를 넘겨 보거나, 사람과 파일로 전환해 보세요. 행을 선택해 삭제할 수도 있습니다.

블록은 복사해 사용하는 마크업입니다. 페이지의 텍스트 색상과 크기를 따르며, 미리보기에서는 body에 fg-text-body text-sm 클래스를 설정합니다. 각 블록은 크기 컨테이너이므로 넓은 페이지, 사이드바 너비의 공간, 대화 상자 어디서든 자체 너비에 맞춰 배치가 바뀝니다.

#구성 요소

  • 하나의 시트. 시트 안에 카드를 겹쳐 넣는 대신 얇은 구분선 bt(1) bt-solid b-line-hair로 영역을 나눕니다.
  • 헤더는 두 부분으로 나뉩니다. 한쪽에는 워크스페이스 이름과 조건에 맞는 행의 개수를, 다른 쪽에는 프로젝트·사람·파일을 전환하는 세그먼트 컨트롤과 기본 작업을 배치합니다. flex flex-wrap items-center justify-between을 적용하므로 시트가 좁으면 세그먼트 컨트롤과 기본 작업이 제목 아래로 내려갑니다.
  • 검색, 필터, 정렬은 공간이 부족하면 줄바꿈되는 한 행에 배치합니다. 200px에서 320px까지 늘어나는 검색 입력 그룹, 필터 바의 버튼, 정렬 순서를 고르는 볼록한 셀렉트가 들어가며, 셀렉트는 ml-auto로 행의 끝에 배치합니다. 적용한 필터는 그 아래 별도의 줄에 칩으로 표시되며, 각 칩으로 필터를 하나씩 해제할 수 있습니다.
  • 정렬 상태는 열 머리글에 표시합니다. 정렬 기준 열의 머리글에 aria-sort를 지정하면 표는 해당 머리글을 진한 글자색과 셰브런으로 표시합니다. 정렬 순서는 셀렉트에서 바꿉니다.
  • 표는 자체 영역에서 스크롤됩니다. scroll-area-inline 클래스를 적용한 스크롤 영역에 표를 넣습니다. 시트가 좁아지면 페이지가 아니라 표만 스크롤되고, 열이 더 이어지는 가장자리는 흐리게 표시됩니다.
  • 데이터 종류마다 첫 번째 셀이 다릅니다. 프로젝트는 이름 아래에 도메인을, 사람은 아바타 옆에 이름과 이메일을, 파일은 아이콘 프레임 옆에 이름을 표시합니다. 첫 번째 셀은 <th scope="row">이므로 보조 기술은 같은 행의 데이터 셀을 읽을 때 이 행 머리글도 함께 읽습니다.
  • 선택은 조건에 맞는 행을 대상으로 합니다. 선택된 행에는 table-row에 aria-selected="true"를 지정해 선택 상태의 색상을 표시하고, 해당 행의 체크박스도 체크합니다. 헤더 체크박스는 모든 페이지에서 검색어와 필터에 맞는 행을 모두 선택하며, 일부만 선택되어 있으면 indeterminate 상태가 됩니다. 조건에 더 이상 맞지 않는 행은 선택에서 빠지므로 “15개 중 3개 선택됨”은 검색과 필터에 맞는 행만 집계합니다.
  • 푸터는 두 부분으로 나뉩니다. 한쪽에는 선택 상태와, 선택한 행이 있을 때 표시되는 삭제 및 선택 해제 버튼을, 다른 쪽에는 표시 범위와 버튼으로 구성한 페이지네이션을 배치합니다. 첫 페이지에서는 이전 버튼이, 마지막 페이지에서는 다음 버튼이 비활성화됩니다. 페이지가 많으면 첫 페이지, 마지막 페이지, 현재 페이지의 앞뒤 페이지를 남기고 그 사이는 생략 표시로 나타냅니다.
  • 행별 작업은 행 끝의 눈에 띄지 않는 버튼으로 여는 메뉴에 들어갑니다. 버튼 이름에는 “Atlas 작업”처럼 해당 행의 이름을 포함합니다.
  • 조건에 맞는 항목이 없으면 그 사실을 알립니다. 빈 상태가 본문을 채우고, 검색어와 필터를 지워 돌아갈 방법을 제공합니다.

#스크립트가 필요한 동작

행은 데이터이므로 예제의 main.js가 data.js의 데이터를 마크업에 들어 있는 데이터 종류별 템플릿에 작성합니다. 스타일시트와 유틸리티는 마크업에서, 텍스트는 데이터에서 가져옵니다. 이 예제는 필터 바의 두 모듈을 공유합니다. query.js는 일반 행을 검색, 필터링, 정렬하고 페이지로 나누며, filters.js는 필터 바를 동작시킵니다. 실제 제품에서는 이런 질의를 데이터 소스에 보내며, 블록은 각 결과를 어떻게 표시하는지 보여 줍니다. 스크립트 없이 사용하려면 모든 영역을 하나의 <form method="get">으로 감싸세요. 검색 필드, 셀렉트, 체크박스가 서버에서 처리할 수 있는 쿼리 문자열이 되고, 페이지네이션은 링크가 됩니다.

#선택한 행에 적용할 작업

예제에서는 선택한 행에 적용할 작업이 하나뿐이므로 푸터의 개수 옆에 둡니다. 작업이 여러 개라면 선택한 행의 개수, 작업, 선택 해제 기능을 플로팅 도구 모음에 표시하세요. sticky bottom(16)을 적용해 시트 하단에 배치하거나 뷰포트 하단에 고정하고, 선택한 행이 있는 동안 표시합니다.

선택한 행에 적용할 작업

<div class="toolbar toolbar-floating flex-wrap justify-center" role="toolbar" aria-label="2 projects selected">  <span class="px-xs fg-text-strong">2 selected</span>  <span class="toolbar-separator" role="separator" aria-orientation="vertical"></span>  <button type="button" class="btn btn-quiet btn-sm">    <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">      <path d="M8 1.3333C4 4.6667 3.6667 8.6667 5.6667 12.3333H10.3333C12.3333 8.6667 12 4.6667 8 1.3333Z" /><circle cx="8" cy="6.6667" r="0.85" fill="currentColor" stroke="none" /><path d="M10.016 12.3333Q10.1079 12.4463 10.2446 12.5147L12.5342 13.6594A0.6999 0.6999 0 0 0 13.5377 13.1484L14.1443 9.5091Q14.1989 9.1824 13.9807 8.9328L11.9808 6.6473A0.7011 0.7011 0 0 0 11.3582 6.4146C11.5022 7.0678 11.5536 7.7269 11.5195 8.3865L11.635 7.7707L13.1346 9.4845L12.6181 12.5833L10.8942 11.7215L11.1203 10.5157C10.924 11.1275 10.6597 11.7349 10.3333 12.3333H10.016ZM4.6418 6.4146A0.6958 0.6958 0 0 0 4.0192 6.6473L2.0193 8.9328Q1.8012 9.1824 1.8557 9.5091L2.4623 13.1484A0.6999 0.6999 0 0 0 3.4658 13.6594L5.7554 12.5147Q5.8921 12.4463 5.984 12.3333H5.6667C5.3403 11.7349 5.076 11.1275 4.8797 10.5157L5.1058 11.7215L3.3819 12.5833L2.8654 9.4845L4.365 7.7707L4.4805 8.3865C4.4464 7.7269 4.4978 7.0678 4.6418 6.4146Z" fill="currentColor" stroke="none" fill-rule="evenodd" /><path d="M6.6667 15L9.3333 15" />    </svg>Redeploy  </button>  <button type="button" class="btn btn-quiet btn-sm">    <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">      <path d="M8.5 9L8.4994 1.9755A0.5 0.5 0 0 0 7.5054 1.9266L7.5 2L7.5014 9.0379A0.5007 0.5007 0 0 0 7.5892 9.285A0.7044 0.7044 0 0 0 8.4108 9.285A0.4996 0.4996 0 0 0 8.5 9Z" fill="currentColor" stroke="none" fill-rule="evenodd" /><path d="M5 6L7.8586 8.8586A0.2 0.2 0 0 0 8.1414 8.8586L11 6" /><path d="M2.5 10.5L2.5 12.5A1 1 0 0 0 3.5 13.5L12.5 13.5A1 1 0 0 0 13.5 12.5L13.5 10.5" />    </svg>Export  </button>  <button type="button" class="btn btn-quiet btn-sm btn-danger">    <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">      <path d="M2.5 4.5L13.5 4.5" /><path d="M4 4.5L4.4501 13.0526A1 1 0 0 0 5.4488 14L10.5512 14A1 1 0 0 0 11.5499 13.0526L12 4.5" /><path d="M6 4.5L6 3A1 1 0 0 1 7 2L9 2A1 1 0 0 1 10 3L10 4.5" /><path d="M8 7.5L8 11" />    </svg>Delete  </button>  <span class="toolbar-separator" role="separator" aria-orientation="vertical"></span>  <button type="button" class="btn btn-quiet btn-square btn-sm" aria-label="Clear the selection">    <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">      <path d="M4 4L12 12" /><path d="M4 12L12 4" />    </svg>  </button></div>
import RocketIcon from '@master/icons-react/native/16/soft/rocket'import DownloadIcon from '@master/icons-react/native/16/soft/download'import TrashIcon from '@master/icons-react/native/16/soft/trash'import XIcon from '@master/icons-react/native/16/soft/x'<div className="toolbar toolbar-floating flex-wrap justify-center" role="toolbar" aria-label="2 projects selected">  <span className="px-xs fg-text-strong">2 selected</span>  <span className="toolbar-separator" role="separator" aria-orientation="vertical"></span>  <button type="button" className="btn btn-quiet btn-sm">    <RocketIcon className="icon" />Redeploy  </button>  <button type="button" className="btn btn-quiet btn-sm">    <DownloadIcon className="icon" />Export  </button>  <button type="button" className="btn btn-quiet btn-sm btn-danger">    <TrashIcon className="icon" />Delete  </button>  <span className="toolbar-separator" role="separator" aria-orientation="vertical"></span>  <button type="button" className="btn btn-quiet btn-square btn-sm" aria-label="Clear the selection">    <XIcon className="icon" />  </button></div>
<script>  import RocketIcon from '@master/icons-svelte/native/16/soft/rocket'  import DownloadIcon from '@master/icons-svelte/native/16/soft/download'  import TrashIcon from '@master/icons-svelte/native/16/soft/trash'  import XIcon from '@master/icons-svelte/native/16/soft/x'</script><div class="toolbar toolbar-floating flex-wrap justify-center" role="toolbar" aria-label="2 projects selected">  <span class="px-xs fg-text-strong">2 selected</span>  <span class="toolbar-separator" role="separator" aria-orientation="vertical"></span>  <button type="button" class="btn btn-quiet btn-sm"><RocketIcon class="icon" />Redeploy</button>  <button type="button" class="btn btn-quiet btn-sm"><DownloadIcon class="icon" />Export</button>  <button type="button" class="btn btn-quiet btn-sm btn-danger">    <TrashIcon class="icon" />Delete  </button>  <span class="toolbar-separator" role="separator" aria-orientation="vertical"></span>  <button type="button" class="btn btn-quiet btn-square btn-sm" aria-label="Clear the selection">    <XIcon class="icon" />  </button></div>
<script setup>import RocketIcon from '@master/icons-vue/native/16/soft/rocket'import DownloadIcon from '@master/icons-vue/native/16/soft/download'import TrashIcon from '@master/icons-vue/native/16/soft/trash'import XIcon from '@master/icons-vue/native/16/soft/x'</script><template>  <div class="toolbar toolbar-floating flex-wrap justify-center" role="toolbar" aria-label="2 projects selected">    <span class="px-xs fg-text-strong">2 selected</span>    <span class="toolbar-separator" role="separator" aria-orientation="vertical"></span>    <button type="button" class="btn btn-quiet btn-sm"><RocketIcon class="icon" />Redeploy</button>    <button type="button" class="btn btn-quiet btn-sm"><DownloadIcon class="icon" />Export</button>    <button type="button" class="btn btn-quiet btn-sm btn-danger">      <TrashIcon class="icon" />Delete    </button>    <span class="toolbar-separator" role="separator" aria-orientation="vertical"></span>    <button type="button" class="btn btn-quiet btn-square btn-sm" aria-label="Clear the selection">      <XIcon class="icon" />    </button>  </div></template>

#접근성

  • 시트는 <section>이며, 시트의 제목을 접근 가능한 이름으로 사용합니다. 표의 이름도 이 제목으로 지정합니다.
  • 각 체크박스 이름에는 “Atlas 선택”처럼 해당 행의 이름을 포함합니다. 헤더 체크박스의 이름은 “프로젝트 15개 모두 선택”처럼 무엇을 선택하는지 알려 줍니다.
  • 제목 아래의 개수는 일반 텍스트입니다. sr-only를 지정한 상태 영역이 “3페이지 중 2페이지”, “프로젝트 3개 삭제됨”처럼 작업 결과를 알립니다. 포커스는 누른 요소에 남으며, 그 요소가 있던 행이 사라지면 헤더 체크박스로 이동합니다.
  • 작업 열의 제목은 화면에서 숨기되 보조 기술에서 읽을 수 있게 합니다.
  • 페이지 탐색에는 레이블이 있는 <nav>를 사용합니다. 페이지는 현재 화면을 그 자리에서 바꾸므로 버튼으로 작성하고, 현재 페이지에는 aria-current="page"를 지정합니다.
  • 각 행의 첫 번째 셀은 <th scope="row">입니다. 따라서 스크린 리더는 셀을 읽을 때 해당 프로젝트, 사람 또는 파일의 이름도 함께 읽습니다.
  • 필터는 “프로젝트 필터”라는 이름의 팝오버에서 열립니다. 행과 메시지를 읽는 방식은 필터 바를 참고하세요.
  • 표는 스크롤 영역 안에서 가로로 스크롤됩니다. 표 안의 체크박스와 버튼을 통해 키보드로 스크롤 영역에 접근할 수 있습니다. 표 안에 포커스를 받을 수 있는 요소가 없다면 스크롤 영역에 tabindex="0", 역할, 접근 가능한 이름을 지정해야 합니다.