칸반
여러 열로 이루어진 보드입니다. 드래그하거나 키보드를 쓰거나 자리를 골라 항목을 열 안에서 또는 다른 열로 옮깁니다.
이 페이지의 내용
칸반은 여러 열로 이루어진 보드입니다. 각 열은 목록을 담은, 이름이 있는 섹션이며, 항목을 같은 열의 다른 자리나 다른 열로 옮길 수 있습니다. 각 항목에는 작은 컨트롤이 두 개 있습니다. 하나는 포인터나 키보드로 항목을 옮기는 핸들이고, 다른 하나는 드래그 없이 열과 위치를 고르는 이동 폼을 여는 버튼입니다. 항목에 무엇을 표시할지는 페이지가 정합니다. 여기서는 배지와 아바타가 있는 카드입니다. 이동은 kanban 동작이 처리하며, 이동을 확정하기 전에는 아무것도 움직이지 않습니다.
칸반
<div class="kanban h(376)" role="group" aria-label="Launch plan"> <section class="kanban-column" data-value="backlog" aria-labelledby="launch-backlog"> <header class="kanban-header"> <h3 class="kanban-title" id="launch-backlog">Backlog</h3> </header> <ol class="kanban-items"> <li class="kanban-item" data-value="emails"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Audit the onboarding emails</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Audit the onboarding emails"> <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.2559 2.3817A0.4996 0.4996 0 0 0 4.1667 2.6667L4.1673 13.3578A0.5 0.5 0 0 0 5.1613 13.4067L5.1667 13.3333L5.1653 2.6288A0.5007 0.5007 0 0 0 5.0775 2.3817A0.7044 0.7044 0 0 0 4.2559 2.3817Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M2.3333 5L4.5253 2.8081A0.2 0.2 0 0 1 4.8081 2.8081L7 5" transform="rotate(90 8 8)" /><path d="M11.8333 13.3333L11.8327 2.6422A0.5 0.5 0 0 0 10.8387 2.5933L10.8333 2.6667L10.8347 13.3712A0.5007 0.5007 0 0 0 10.9225 13.6183A0.7044 0.7044 0 0 0 11.7441 13.6183A0.4996 0.4996 0 0 0 11.8333 13.3333Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M9 11L11.1919 13.1919A0.2 0.2 0 0 0 11.4747 13.1919L13.6667 11" transform="rotate(90 8 8)" /> </svg> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Audit the onboarding emails"> <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="6" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="12" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="12" r="1" fill="currentColor" stroke="none" /> </svg> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Lifecycle</span> <span class="avatar avatar-xs" role="img" aria-label="Yi-ching Lin">YL</span> </div> </article> </li> <li class="kanban-item" data-value="pricing"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Price the annual plan</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Price the annual plan"> <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.2559 2.3817A0.4996 0.4996 0 0 0 4.1667 2.6667L4.1673 13.3578A0.5 0.5 0 0 0 5.1613 13.4067L5.1667 13.3333L5.1653 2.6288A0.5007 0.5007 0 0 0 5.0775 2.3817A0.7044 0.7044 0 0 0 4.2559 2.3817Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M2.3333 5L4.5253 2.8081A0.2 0.2 0 0 1 4.8081 2.8081L7 5" transform="rotate(90 8 8)" /><path d="M11.8333 13.3333L11.8327 2.6422A0.5 0.5 0 0 0 10.8387 2.5933L10.8333 2.6667L10.8347 13.3712A0.5007 0.5007 0 0 0 10.9225 13.6183A0.7044 0.7044 0 0 0 11.7441 13.6183A0.4996 0.4996 0 0 0 11.8333 13.3333Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M9 11L11.1919 13.1919A0.2 0.2 0 0 0 11.4747 13.1919L13.6667 11" transform="rotate(90 8 8)" /> </svg> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Price the annual plan"> <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="6" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="12" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="12" r="1" fill="currentColor" stroke="none" /> </svg> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Pricing</span> <span class="avatar avatar-xs" role="img" aria-label="Po-han Chen">PC</span> </div> </article> </li> <li class="kanban-item" data-value="tour"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Record the product tour</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Record the product tour"> <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.2559 2.3817A0.4996 0.4996 0 0 0 4.1667 2.6667L4.1673 13.3578A0.5 0.5 0 0 0 5.1613 13.4067L5.1667 13.3333L5.1653 2.6288A0.5007 0.5007 0 0 0 5.0775 2.3817A0.7044 0.7044 0 0 0 4.2559 2.3817Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M2.3333 5L4.5253 2.8081A0.2 0.2 0 0 1 4.8081 2.8081L7 5" transform="rotate(90 8 8)" /><path d="M11.8333 13.3333L11.8327 2.6422A0.5 0.5 0 0 0 10.8387 2.5933L10.8333 2.6667L10.8347 13.3712A0.5007 0.5007 0 0 0 10.9225 13.6183A0.7044 0.7044 0 0 0 11.7441 13.6183A0.4996 0.4996 0 0 0 11.8333 13.3333Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M9 11L11.1919 13.1919A0.2 0.2 0 0 0 11.4747 13.1919L13.6667 11" transform="rotate(90 8 8)" /> </svg> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Record the product tour"> <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="6" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="12" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="12" r="1" fill="currentColor" stroke="none" /> </svg> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Video</span> <span class="avatar avatar-xs" role="img" aria-label="Mei Kato">MK</span> </div> </article> </li> <li class="kanban-item" data-value="translate"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Translate the pricing page</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Translate the pricing 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="M4.2559 2.3817A0.4996 0.4996 0 0 0 4.1667 2.6667L4.1673 13.3578A0.5 0.5 0 0 0 5.1613 13.4067L5.1667 13.3333L5.1653 2.6288A0.5007 0.5007 0 0 0 5.0775 2.3817A0.7044 0.7044 0 0 0 4.2559 2.3817Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M2.3333 5L4.5253 2.8081A0.2 0.2 0 0 1 4.8081 2.8081L7 5" transform="rotate(90 8 8)" /><path d="M11.8333 13.3333L11.8327 2.6422A0.5 0.5 0 0 0 10.8387 2.5933L10.8333 2.6667L10.8347 13.3712A0.5007 0.5007 0 0 0 10.9225 13.6183A0.7044 0.7044 0 0 0 11.7441 13.6183A0.4996 0.4996 0 0 0 11.8333 13.3333Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M9 11L11.1919 13.1919A0.2 0.2 0 0 0 11.4747 13.1919L13.6667 11" transform="rotate(90 8 8)" /> </svg> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Translate the pricing 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"> <circle cx="6" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="12" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="12" r="1" fill="currentColor" stroke="none" /> </svg> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Localization</span> <span class="avatar avatar-xs" role="img" aria-label="Ana Souza">AS</span> </div> </article> </li> </ol> <p class="kanban-empty">Nothing waiting</p> </section> <section class="kanban-column" data-value="progress" aria-labelledby="launch-progress"> <header class="kanban-header"> <h3 class="kanban-title" id="launch-progress">In progress</h3> </header> <ol class="kanban-items"> <li class="kanban-item" data-value="post"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Draft the launch post</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Draft the launch post"> <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.2559 2.3817A0.4996 0.4996 0 0 0 4.1667 2.6667L4.1673 13.3578A0.5 0.5 0 0 0 5.1613 13.4067L5.1667 13.3333L5.1653 2.6288A0.5007 0.5007 0 0 0 5.0775 2.3817A0.7044 0.7044 0 0 0 4.2559 2.3817Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M2.3333 5L4.5253 2.8081A0.2 0.2 0 0 1 4.8081 2.8081L7 5" transform="rotate(90 8 8)" /><path d="M11.8333 13.3333L11.8327 2.6422A0.5 0.5 0 0 0 10.8387 2.5933L10.8333 2.6667L10.8347 13.3712A0.5007 0.5007 0 0 0 10.9225 13.6183A0.7044 0.7044 0 0 0 11.7441 13.6183A0.4996 0.4996 0 0 0 11.8333 13.3333Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M9 11L11.1919 13.1919A0.2 0.2 0 0 0 11.4747 13.1919L13.6667 11" transform="rotate(90 8 8)" /> </svg> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Draft the launch post"> <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="6" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="12" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="12" r="1" fill="currentColor" stroke="none" /> </svg> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Writing</span> <span class="avatar avatar-xs" role="img" aria-label="Mei Kato">MK</span> </div> </article> </li> <li class="kanban-item" data-value="table"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Design the comparison table</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Design the comparison table"> <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.2559 2.3817A0.4996 0.4996 0 0 0 4.1667 2.6667L4.1673 13.3578A0.5 0.5 0 0 0 5.1613 13.4067L5.1667 13.3333L5.1653 2.6288A0.5007 0.5007 0 0 0 5.0775 2.3817A0.7044 0.7044 0 0 0 4.2559 2.3817Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M2.3333 5L4.5253 2.8081A0.2 0.2 0 0 1 4.8081 2.8081L7 5" transform="rotate(90 8 8)" /><path d="M11.8333 13.3333L11.8327 2.6422A0.5 0.5 0 0 0 10.8387 2.5933L10.8333 2.6667L10.8347 13.3712A0.5007 0.5007 0 0 0 10.9225 13.6183A0.7044 0.7044 0 0 0 11.7441 13.6183A0.4996 0.4996 0 0 0 11.8333 13.3333Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M9 11L11.1919 13.1919A0.2 0.2 0 0 0 11.4747 13.1919L13.6667 11" transform="rotate(90 8 8)" /> </svg> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Design the comparison table"> <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="6" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="12" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="12" r="1" fill="currentColor" stroke="none" /> </svg> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Design</span> <span class="avatar avatar-xs" role="img" aria-label="Yi-ching Lin">YL</span> </div> </article> </li> </ol> <p class="kanban-empty">Nothing in progress</p> </section> <section class="kanban-column" data-value="review" aria-labelledby="launch-review"> <header class="kanban-header"> <h3 class="kanban-title" id="launch-review">In review</h3> </header> <ol class="kanban-items"></ol> <p class="kanban-empty">Nothing in review</p> </section> <section class="kanban-column" data-value="done" aria-labelledby="launch-done"> <header class="kanban-header"> <h3 class="kanban-title" id="launch-done">Done</h3> </header> <ol class="kanban-items"> <li class="kanban-item" data-value="name"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Name the release</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Name the release"> <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.2559 2.3817A0.4996 0.4996 0 0 0 4.1667 2.6667L4.1673 13.3578A0.5 0.5 0 0 0 5.1613 13.4067L5.1667 13.3333L5.1653 2.6288A0.5007 0.5007 0 0 0 5.0775 2.3817A0.7044 0.7044 0 0 0 4.2559 2.3817Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M2.3333 5L4.5253 2.8081A0.2 0.2 0 0 1 4.8081 2.8081L7 5" transform="rotate(90 8 8)" /><path d="M11.8333 13.3333L11.8327 2.6422A0.5 0.5 0 0 0 10.8387 2.5933L10.8333 2.6667L10.8347 13.3712A0.5007 0.5007 0 0 0 10.9225 13.6183A0.7044 0.7044 0 0 0 11.7441 13.6183A0.4996 0.4996 0 0 0 11.8333 13.3333Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M9 11L11.1919 13.1919A0.2 0.2 0 0 0 11.4747 13.1919L13.6667 11" transform="rotate(90 8 8)" /> </svg> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Name the release"> <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="6" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="12" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="12" r="1" fill="currentColor" stroke="none" /> </svg> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Brand</span> <span class="avatar avatar-xs" role="img" aria-label="Po-han Chen">PC</span> </div> </article> </li> <li class="kanban-item" data-value="date"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Book the launch date</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Book the launch date"> <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.2559 2.3817A0.4996 0.4996 0 0 0 4.1667 2.6667L4.1673 13.3578A0.5 0.5 0 0 0 5.1613 13.4067L5.1667 13.3333L5.1653 2.6288A0.5007 0.5007 0 0 0 5.0775 2.3817A0.7044 0.7044 0 0 0 4.2559 2.3817Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M2.3333 5L4.5253 2.8081A0.2 0.2 0 0 1 4.8081 2.8081L7 5" transform="rotate(90 8 8)" /><path d="M11.8333 13.3333L11.8327 2.6422A0.5 0.5 0 0 0 10.8387 2.5933L10.8333 2.6667L10.8347 13.3712A0.5007 0.5007 0 0 0 10.9225 13.6183A0.7044 0.7044 0 0 0 11.7441 13.6183A0.4996 0.4996 0 0 0 11.8333 13.3333Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M9 11L11.1919 13.1919A0.2 0.2 0 0 0 11.4747 13.1919L13.6667 11" transform="rotate(90 8 8)" /> </svg> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Book the launch date"> <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="6" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="12" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="12" r="1" fill="currentColor" stroke="none" /> </svg> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Planning</span> <span class="avatar avatar-xs" role="img" aria-label="Ana Souza">AS</span> </div> </article> </li> </ol> <p class="kanban-empty">Nothing done yet</p> </section> <div class="popover popover-end" popover id="launch-mover"> <form class="kanban-mover"> <label class="field">Column<select class="select" name="column"></select></label> <label class="field">Position<select class="select" name="position"></select></label> <div class="kanban-mover-actions"> <button type="button" class="btn btn-sm" popovertarget="launch-mover" popovertargetaction="hide"> Cancel </button> <button type="submit" class="btn btn-sm btn-primary">Move</button> </div> </form> </div> <div class="kanban-preview" popover="manual" aria-hidden="true"></div> <p class="kanban-status" role="status"></p></div><script type="module"> import { attach } from '@master/ui/behaviors' attach()</script>import { useEffect, useRef } from 'react'import { attach } from '@master/ui/behaviors'import ArrowLeftRightIcon from '@master/icons-react/native/16/soft/arrow-left-right'import GripVerticalIcon from '@master/icons-react/native/16/soft/grip-vertical'export function Example() { const root = useRef<HTMLDivElement>(null) useEffect(() => attach(root.current!), []) return ( <div ref={root} className="kanban h(376)" role="group" aria-label="Launch plan"> <section className="kanban-column" data-value="backlog" aria-labelledby="launch-backlog"> <header className="kanban-header"> <h3 className="kanban-title" id="launch-backlog">Backlog</h3> </header> <ol className="kanban-items"> <li className="kanban-item" data-value="emails"> <article className="card gap-xs"> <div className="card-header"> <p className="card-title">Audit the onboarding emails</p> <span className="card-action kanban-controls"> <button type="button" className="kanban-move" popoverTarget="launch-mover" aria-label="Move Audit the onboarding emails"> <ArrowLeftRightIcon className="icon" /> </button> <button type="button" className="kanban-handle" aria-pressed="false" aria-label="Drag Audit the onboarding emails"> <GripVerticalIcon className="icon" /> </button> </span> </div> <div className="flex items-center justify-between gap-xs"> <span className="badge badge-sm">Lifecycle</span> <span className="avatar avatar-xs" role="img" aria-label="Yi-ching Lin">YL</span> </div> </article> </li> <li className="kanban-item" data-value="pricing"> <article className="card gap-xs"> <div className="card-header"> <p className="card-title">Price the annual plan</p> <span className="card-action kanban-controls"> <button type="button" className="kanban-move" popoverTarget="launch-mover" aria-label="Move Price the annual plan"> <ArrowLeftRightIcon className="icon" /> </button> <button type="button" className="kanban-handle" aria-pressed="false" aria-label="Drag Price the annual plan"> <GripVerticalIcon className="icon" /> </button> </span> </div> <div className="flex items-center justify-between gap-xs"> <span className="badge badge-sm">Pricing</span> <span className="avatar avatar-xs" role="img" aria-label="Po-han Chen">PC</span> </div> </article> </li> <li className="kanban-item" data-value="tour"> <article className="card gap-xs"> <div className="card-header"> <p className="card-title">Record the product tour</p> <span className="card-action kanban-controls"> <button type="button" className="kanban-move" popoverTarget="launch-mover" aria-label="Move Record the product tour"> <ArrowLeftRightIcon className="icon" /> </button> <button type="button" className="kanban-handle" aria-pressed="false" aria-label="Drag Record the product tour"> <GripVerticalIcon className="icon" /> </button> </span> </div> <div className="flex items-center justify-between gap-xs"> <span className="badge badge-sm">Video</span> <span className="avatar avatar-xs" role="img" aria-label="Mei Kato">MK</span> </div> </article> </li> <li className="kanban-item" data-value="translate"> <article className="card gap-xs"> <div className="card-header"> <p className="card-title">Translate the pricing page</p> <span className="card-action kanban-controls"> <button type="button" className="kanban-move" popoverTarget="launch-mover" aria-label="Move Translate the pricing page"> <ArrowLeftRightIcon className="icon" /> </button> <button type="button" className="kanban-handle" aria-pressed="false" aria-label="Drag Translate the pricing page"> <GripVerticalIcon className="icon" /> </button> </span> </div> <div className="flex items-center justify-between gap-xs"> <span className="badge badge-sm">Localization</span> <span className="avatar avatar-xs" role="img" aria-label="Ana Souza">AS</span> </div> </article> </li> </ol> <p className="kanban-empty">Nothing waiting</p> </section> <section className="kanban-column" data-value="progress" aria-labelledby="launch-progress"> <header className="kanban-header"> <h3 className="kanban-title" id="launch-progress">In progress</h3> </header> <ol className="kanban-items"> <li className="kanban-item" data-value="post"> <article className="card gap-xs"> <div className="card-header"> <p className="card-title">Draft the launch post</p> <span className="card-action kanban-controls"> <button type="button" className="kanban-move" popoverTarget="launch-mover" aria-label="Move Draft the launch post"> <ArrowLeftRightIcon className="icon" /> </button> <button type="button" className="kanban-handle" aria-pressed="false" aria-label="Drag Draft the launch post"> <GripVerticalIcon className="icon" /> </button> </span> </div> <div className="flex items-center justify-between gap-xs"> <span className="badge badge-sm">Writing</span> <span className="avatar avatar-xs" role="img" aria-label="Mei Kato">MK</span> </div> </article> </li> <li className="kanban-item" data-value="table"> <article className="card gap-xs"> <div className="card-header"> <p className="card-title">Design the comparison table</p> <span className="card-action kanban-controls"> <button type="button" className="kanban-move" popoverTarget="launch-mover" aria-label="Move Design the comparison table"> <ArrowLeftRightIcon className="icon" /> </button> <button type="button" className="kanban-handle" aria-pressed="false" aria-label="Drag Design the comparison table"> <GripVerticalIcon className="icon" /> </button> </span> </div> <div className="flex items-center justify-between gap-xs"> <span className="badge badge-sm">Design</span> <span className="avatar avatar-xs" role="img" aria-label="Yi-ching Lin">YL</span> </div> </article> </li> </ol> <p className="kanban-empty">Nothing in progress</p> </section> <section className="kanban-column" data-value="review" aria-labelledby="launch-review"> <header className="kanban-header"> <h3 className="kanban-title" id="launch-review">In review</h3> </header> <ol className="kanban-items"></ol> <p className="kanban-empty">Nothing in review</p> </section> <section className="kanban-column" data-value="done" aria-labelledby="launch-done"> <header className="kanban-header"> <h3 className="kanban-title" id="launch-done">Done</h3> </header> <ol className="kanban-items"> <li className="kanban-item" data-value="name"> <article className="card gap-xs"> <div className="card-header"> <p className="card-title">Name the release</p> <span className="card-action kanban-controls"> <button type="button" className="kanban-move" popoverTarget="launch-mover" aria-label="Move Name the release"> <ArrowLeftRightIcon className="icon" /> </button> <button type="button" className="kanban-handle" aria-pressed="false" aria-label="Drag Name the release"> <GripVerticalIcon className="icon" /> </button> </span> </div> <div className="flex items-center justify-between gap-xs"> <span className="badge badge-sm">Brand</span> <span className="avatar avatar-xs" role="img" aria-label="Po-han Chen">PC</span> </div> </article> </li> <li className="kanban-item" data-value="date"> <article className="card gap-xs"> <div className="card-header"> <p className="card-title">Book the launch date</p> <span className="card-action kanban-controls"> <button type="button" className="kanban-move" popoverTarget="launch-mover" aria-label="Move Book the launch date"> <ArrowLeftRightIcon className="icon" /> </button> <button type="button" className="kanban-handle" aria-pressed="false" aria-label="Drag Book the launch date"> <GripVerticalIcon className="icon" /> </button> </span> </div> <div className="flex items-center justify-between gap-xs"> <span className="badge badge-sm">Planning</span> <span className="avatar avatar-xs" role="img" aria-label="Ana Souza">AS</span> </div> </article> </li> </ol> <p className="kanban-empty">Nothing done yet</p> </section> <div className="popover popover-end" popover="" id="launch-mover"> <form className="kanban-mover"> <label className="field">Column<select className="select" name="column"></select></label> <label className="field">Position<select className="select" name="position"></select></label> <div className="kanban-mover-actions"> <button type="button" className="btn btn-sm" popoverTarget="launch-mover" popoverTargetAction="hide"> Cancel </button> <button type="submit" className="btn btn-sm btn-primary">Move</button> </div> </form> </div> <div className="kanban-preview" popover="manual" aria-hidden="true"></div> <p className="kanban-status" role="status"></p> </div> )}<script> import { attach } from '@master/ui/behaviors' import ArrowLeftRightIcon from '@master/icons-svelte/native/16/soft/arrow-left-right' import GripVerticalIcon from '@master/icons-svelte/native/16/soft/grip-vertical'</script><div class="kanban h(376)" role="group" aria-label="Launch plan" {@attach attach}> <section class="kanban-column" data-value="backlog" aria-labelledby="launch-backlog"> <header class="kanban-header"> <h3 class="kanban-title" id="launch-backlog">Backlog</h3> </header> <ol class="kanban-items"> <li class="kanban-item" data-value="emails"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Audit the onboarding emails</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Audit the onboarding emails"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Audit the onboarding emails"> <GripVerticalIcon class="icon" /> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Lifecycle</span> <span class="avatar avatar-xs" role="img" aria-label="Yi-ching Lin">YL</span> </div> </article> </li> <li class="kanban-item" data-value="pricing"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Price the annual plan</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Price the annual plan"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Price the annual plan"> <GripVerticalIcon class="icon" /> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Pricing</span> <span class="avatar avatar-xs" role="img" aria-label="Po-han Chen">PC</span> </div> </article> </li> <li class="kanban-item" data-value="tour"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Record the product tour</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Record the product tour"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Record the product tour"> <GripVerticalIcon class="icon" /> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Video</span> <span class="avatar avatar-xs" role="img" aria-label="Mei Kato">MK</span> </div> </article> </li> <li class="kanban-item" data-value="translate"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Translate the pricing page</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Translate the pricing page"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Translate the pricing page"> <GripVerticalIcon class="icon" /> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Localization</span> <span class="avatar avatar-xs" role="img" aria-label="Ana Souza">AS</span> </div> </article> </li> </ol> <p class="kanban-empty">Nothing waiting</p> </section> <section class="kanban-column" data-value="progress" aria-labelledby="launch-progress"> <header class="kanban-header"> <h3 class="kanban-title" id="launch-progress">In progress</h3> </header> <ol class="kanban-items"> <li class="kanban-item" data-value="post"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Draft the launch post</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Draft the launch post"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Draft the launch post"> <GripVerticalIcon class="icon" /> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Writing</span> <span class="avatar avatar-xs" role="img" aria-label="Mei Kato">MK</span> </div> </article> </li> <li class="kanban-item" data-value="table"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Design the comparison table</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Design the comparison table"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Design the comparison table"> <GripVerticalIcon class="icon" /> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Design</span> <span class="avatar avatar-xs" role="img" aria-label="Yi-ching Lin">YL</span> </div> </article> </li> </ol> <p class="kanban-empty">Nothing in progress</p> </section> <section class="kanban-column" data-value="review" aria-labelledby="launch-review"> <header class="kanban-header"> <h3 class="kanban-title" id="launch-review">In review</h3> </header> <ol class="kanban-items"></ol> <p class="kanban-empty">Nothing in review</p> </section> <section class="kanban-column" data-value="done" aria-labelledby="launch-done"> <header class="kanban-header"> <h3 class="kanban-title" id="launch-done">Done</h3> </header> <ol class="kanban-items"> <li class="kanban-item" data-value="name"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Name the release</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Name the release"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Name the release"> <GripVerticalIcon class="icon" /> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Brand</span> <span class="avatar avatar-xs" role="img" aria-label="Po-han Chen">PC</span> </div> </article> </li> <li class="kanban-item" data-value="date"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Book the launch date</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Book the launch date"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Book the launch date"> <GripVerticalIcon class="icon" /> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Planning</span> <span class="avatar avatar-xs" role="img" aria-label="Ana Souza">AS</span> </div> </article> </li> </ol> <p class="kanban-empty">Nothing done yet</p> </section> <div class="popover popover-end" popover id="launch-mover"> <form class="kanban-mover"> <label class="field">Column<select class="select" name="column"></select></label> <label class="field">Position<select class="select" name="position"></select></label> <div class="kanban-mover-actions"> <button type="button" class="btn btn-sm" popovertarget="launch-mover" popovertargetaction="hide"> Cancel </button> <button type="submit" class="btn btn-sm btn-primary">Move</button> </div> </form> </div> <div class="kanban-preview" popover="manual" aria-hidden="true"></div> <p class="kanban-status" role="status"></p></div><script setup>import { onMounted, onUnmounted, ref } from 'vue'import { attach } from '@master/ui/behaviors'import ArrowLeftRightIcon from '@master/icons-vue/native/16/soft/arrow-left-right'import GripVerticalIcon from '@master/icons-vue/native/16/soft/grip-vertical'const root = ref(null)let detachonMounted(() => { detach = attach(root.value) })onUnmounted(() => detach?.())</script><template> <div ref="root" class="kanban h(376)" role="group" aria-label="Launch plan"> <section class="kanban-column" data-value="backlog" aria-labelledby="launch-backlog"> <header class="kanban-header"> <h3 class="kanban-title" id="launch-backlog">Backlog</h3> </header> <ol class="kanban-items"> <li class="kanban-item" data-value="emails"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Audit the onboarding emails</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Audit the onboarding emails"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Audit the onboarding emails"> <GripVerticalIcon class="icon" /> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Lifecycle</span> <span class="avatar avatar-xs" role="img" aria-label="Yi-ching Lin">YL</span> </div> </article> </li> <li class="kanban-item" data-value="pricing"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Price the annual plan</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Price the annual plan"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Price the annual plan"> <GripVerticalIcon class="icon" /> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Pricing</span> <span class="avatar avatar-xs" role="img" aria-label="Po-han Chen">PC</span> </div> </article> </li> <li class="kanban-item" data-value="tour"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Record the product tour</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Record the product tour"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Record the product tour"> <GripVerticalIcon class="icon" /> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Video</span> <span class="avatar avatar-xs" role="img" aria-label="Mei Kato">MK</span> </div> </article> </li> <li class="kanban-item" data-value="translate"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Translate the pricing page</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Translate the pricing page"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Translate the pricing page"> <GripVerticalIcon class="icon" /> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Localization</span> <span class="avatar avatar-xs" role="img" aria-label="Ana Souza">AS</span> </div> </article> </li> </ol> <p class="kanban-empty">Nothing waiting</p> </section> <section class="kanban-column" data-value="progress" aria-labelledby="launch-progress"> <header class="kanban-header"> <h3 class="kanban-title" id="launch-progress">In progress</h3> </header> <ol class="kanban-items"> <li class="kanban-item" data-value="post"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Draft the launch post</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Draft the launch post"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Draft the launch post"> <GripVerticalIcon class="icon" /> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Writing</span> <span class="avatar avatar-xs" role="img" aria-label="Mei Kato">MK</span> </div> </article> </li> <li class="kanban-item" data-value="table"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Design the comparison table</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Design the comparison table"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Design the comparison table"> <GripVerticalIcon class="icon" /> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Design</span> <span class="avatar avatar-xs" role="img" aria-label="Yi-ching Lin">YL</span> </div> </article> </li> </ol> <p class="kanban-empty">Nothing in progress</p> </section> <section class="kanban-column" data-value="review" aria-labelledby="launch-review"> <header class="kanban-header"> <h3 class="kanban-title" id="launch-review">In review</h3> </header> <ol class="kanban-items"></ol> <p class="kanban-empty">Nothing in review</p> </section> <section class="kanban-column" data-value="done" aria-labelledby="launch-done"> <header class="kanban-header"> <h3 class="kanban-title" id="launch-done">Done</h3> </header> <ol class="kanban-items"> <li class="kanban-item" data-value="name"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Name the release</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Name the release"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Name the release"> <GripVerticalIcon class="icon" /> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Brand</span> <span class="avatar avatar-xs" role="img" aria-label="Po-han Chen">PC</span> </div> </article> </li> <li class="kanban-item" data-value="date"> <article class="card gap-xs"> <div class="card-header"> <p class="card-title">Book the launch date</p> <span class="card-action kanban-controls"> <button type="button" class="kanban-move" popovertarget="launch-mover" aria-label="Move Book the launch date"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Book the launch date"> <GripVerticalIcon class="icon" /> </button> </span> </div> <div class="flex items-center justify-between gap-xs"> <span class="badge badge-sm">Planning</span> <span class="avatar avatar-xs" role="img" aria-label="Ana Souza">AS</span> </div> </article> </li> </ol> <p class="kanban-empty">Nothing done yet</p> </section> <div class="popover popover-end" popover id="launch-mover"> <form class="kanban-mover"> <label class="field">Column<select class="select" name="column"></select></label> <label class="field">Position<select class="select" name="position"></select></label> <div class="kanban-mover-actions"> <button type="button" class="btn btn-sm" popovertarget="launch-mover" popovertargetaction="hide"> Cancel </button> <button type="submit" class="btn btn-sm btn-primary">Move</button> </div> </form> </div> <div class="kanban-preview" popover="manual" aria-hidden="true"></div> <p class="kanban-status" role="status"></p> </div></template>정렬 가능 목록은 목록 하나의 순서를 정합니다. 항목이 다른 목록으로도 옮겨 가고, 항목이 속한 목록이 단계, 담당자, 상태처럼 그 항목에 관한 정보를 나타낸다면 칸반을 사용하세요.
#스타일시트가 그리는 요소
- 보드는 가로로 스크롤되는 행입니다. 위 예시의
h(376)처럼, 또는 보드 페이지의 메인 영역처럼 높이를 지정하면 열이 그 높이에서 멈춥니다. - 열은 트레이입니다. 색조와 가는 선으로 오목하게 표현하며, 너비는
--kanban-column-width이고 보드 너비에서 2rem을 뺀 값을 넘지 않으므로 휴대폰에서는 다음 열이 가장자리에 보입니다. 높이는 담긴 내용만큼입니다. 열의 목록인kanban-items만 스크롤되며, 그 위의 헤더는 제자리에 남습니다. - 모서리 하나, 선 하나. 보드에 담긴 카드는
--kanban-radius와--kanban-padding을 따릅니다. 열의 모서리 반경은 이 반경에 항목 둘레의 여백인--kanban-inset을 더한 값이고, 열의 제목은 카드의 텍스트가 시작하는 선에서 시작합니다. - 두 컨트롤은 한 쌍입니다. 각각 24px이고 손가락으로 조작할 때는 대상의 높이가 44px이며, 서로의 중간까지만 넓어지므로 옆 컨트롤 대신 반응하지 않습니다. 핸들에는 손잡이 아이콘을,
kanban-move에는 서로 엇갈리는 화살표 두 개의 아이콘을 넣으며, 둘 다 마크업에 쓰는 Master Icons 그림입니다. 둘 다 포인터나 키보드가 닿기 전까지는 아이콘만 표시합니다.touch-action: none은 핸들에만 적용되므로, 카드의 다른 곳에서 시작한 스와이프는 여전히 스크롤합니다.kanban-controls는 이 한 쌍을 항목 첫 줄의 끝에 둡니다. 손잡이의 점이 자기 상자의 가장자리에서 안쪽으로 들어가 있는 만큼인 .5rem만큼 카드의 패딩 안으로 걸쳐 들어가므로 손잡이는 그 아래 아바타가 끝나는 가장자리에 맞고, 제목의 첫 줄을 기준으로 세로 가운데에 놓입니다. - 이동 버튼은 기다립니다. 포인터를 올릴 수 있는 기기에서는 포인터나 키보드가 해당 항목에 닿을 때까지
kanban-move를 그리지 않으므로, 보드에는 카드마다 손잡이 하나만 보입니다. 터치 화면에서는 항상 그립니다. - 옮기는 동안 항목은 제자리에 남아 흐려지므로 사용자는 항목이 어디서 왔는지 알 수 있고, 손잡이는 오목한 영역 안에 놓입니다.
- 놓일 자리는 간격 한가운데의 선입니다.
kanban-item-target으로 표시된 항목 앞이나,kanban-items-target으로 표시된 목록의 마지막 항목 뒤에 그립니다. 자리를 비켜 주는 항목은 없습니다. 보드는 포인터 아래에서 움직이지 않으며, 그래서 놓일 자리가 제 움직임을 쫓아 흔들리는 일이 없습니다. - 빈 열은 목록 대신
kanban-empty를 표시합니다. 얕은 오목한 영역 안의 짧은 문구입니다. 항목이 놓일 자리가 되면 이 오목한 영역에 표식 색의 링이 둘러집니다. - 옮기는 시트인
kanban-preview는 항목 너비의 작은 솟은 시트에 항목의 이름을 담은 것입니다. 수동 팝오버이므로 최상위 레이어에 놓여 어떤 열의 스크롤에도 잘리지 않으며, 카드의 사본을 담지 않습니다. 따라서 중복된 id, 필드, 이미지가 생기지 않습니다. 포인터를 놓으면 시트는 항목이 들어간 자리로 미끄러지듯 이동한 뒤 사라집니다.
동작 줄이기 설정이 켜져 있으면 시트는 미끄러지듯 이동하지 않고 항목은 서서히 나타나지 않습니다. 강제 색상 모드에서는 열, 오목한 영역, 시트에 윤곽선이 그려지고 선은 시스템 강조 색으로 그려집니다.
#동작
kanban 동작은 kanban 클래스가 있는 루트 요소를 받아, 연결한 동작을 해제하는 함수를 반환합니다.
import { kanban } from '@master/ui/behaviors/kanban.js'const board = kanban(document.querySelector('.kanban'))board.value// [{ value: 'backlog', items: ['emails', 'pricing', 'tour', 'translate'] }, { value: 'progress', items: ['post', 'table'] }, …]board.move('pricing', 'review', 0)// The board dispatches input, then change, once for each move that changed it.document.querySelector('.kanban').addEventListener('change', (event) => { if (event.target === event.currentTarget) save(board.value)})- 포인터. 핸들을 누른 채 4px 넘게 움직이면 항목을 집어 듭니다. 마우스, 펜, 터치 모두 같으며, 드래그를 시작한 포인터만 항목을 옮길 수 있습니다. 항목이 놓일 곳은 포인터 아래의 열, 또는 가로 방향으로 가장 가까운 열이며, 그 열에서 가운데가 포인터보다 아래에 있는 첫 번째 항목의 앞입니다. 포인터가 끝 가까이에 있는 동안 보드는 가로로, 그 열의 목록은 세로로 스크롤됩니다. 포인터를 놓으면 이동이 확정됩니다. 집어 든 자리에서 놓으면 아무것도 바뀌지 않으며, 보드 밖에서 놓거나, Escape 키를 누르거나, 포인터가 취소되거나, 포인터 캡처를 빼앗기면 항목은 원래 자리에 그대로 있습니다.
- 항목 전체(마우스). 마우스로는 링크, 버튼, 필드가 아닌 곳이면 항목의 어디를 눌러도 집어 들 수 있으며, 그 위에서는 커서가 손 모양이 됩니다. 손가락은 핸들로만 항목을 옮깁니다. 항목의 다른 곳을 누르는 것은 목록을 스크롤하는 방법이기 때문입니다. 항목을 누르고 움직이지 않으면 그 자리에 있는 것을 클릭한 것일 뿐입니다.
- 키보드. 핸들에서 Enter 또는 Space 키를 누르면 항목을 집어 듭니다. 핸들을 움직이지 않고 누를 때도 마찬가지입니다. 이어서 방향키로 자리를 고르면 선이 그 자리를 표시합니다. 항목을 집어 들기 전에는 방향키가 아무 동작도 하지 않으므로, 스크린 리더 자체의 방향키 조작은 그대로 작동합니다. Enter 또는 Space 키는 이동을 확정하고, Escape 키는 취소하며, 핸들에서 포커스가 벗어나도 확정됩니다.
- 이동 폼. 항목 안의 버튼 가운데
popovertarget이kanban-mover폼을 담은 팝오버인 버튼은 그 항목에 대한 이동 폼을 엽니다. 팝오버를 열고 닫는 일은 브라우저가 합니다. 동작은 이름이column인 select에 열을, 이름이position인 select에 선택한 열의 자리를 써넣으며, 폼을 제출하면 이동이 확정됩니다. 드래그할 수 없고 키보드도 없는 사용자, 그리고 터치 화면에서 스크린 리더를 쓰는 사용자를 위한 방법입니다. - 하나의 경로. 포인터, 키보드, 이동 폼은 모두
move(item, column, index)를 거쳐 확정하며, 이 메서드는 직접 호출할 수도 있습니다.index는 그 열의 다른 항목들 사이에서의 자리입니다.0은 첫 번째이고, 끝을 넘는 숫자는 맨 끝입니다. 보드를 바꾸는 확정은 항목 노드 자체를 옮기고, 항목이 보이도록 스크롤하고, 핸들에 포커스를 주고, 이벤트를 발생시킵니다. 브라우저가 지원하면moveBefore()를 사용하므로 필드의 텍스트와 포커스가 유지됩니다. 항목이 이미 있는 자리로 확정하면 이벤트가 발생하지 않습니다. - 이동은 그려집니다. 브라우저가 요소 범위의 뷰 전환을 지원하면 확정할 때 보드에서 전환을 시작합니다. 모든 항목은 속한 목록에 의해 잘린 채 새 자리로 미끄러지듯 이동하고, 확정은 한 프레임 뒤에 끝나므로 이때
move는 프로미스를 반환합니다. 그 밖의 브라우저와 동작 줄이기 설정에서는 항목이 바로 제자리에 놓입니다. 이동에는 160ms가 걸리며 그동안 보드는 누름을 받지 않습니다. - 페이지가 옮길 때. 페이지에서 호출한
move는 항목을 보이도록 스크롤하지 않고 포커스도 옮기지 않습니다. 숨겨진 열로는 옮기지 않으며, 이전 이동이 아직 그려지는 동안에는 거부됩니다. 핸들이disabled인 항목은 이동 폼을 포함한 어떤 방법으로도 제자리에 머뭅니다. - 값은 배치입니다. 열마다
{ value, items }하나씩, 열의 순서대로 나열합니다. 값은 확정된 배치이며, 고르는 중인 자리는 반영하지 않습니다. 값을 설정하면 보드가 그 배치로 정렬되며, 이때는 이벤트가 발생하지 않습니다. 보드에 없는 열이나 항목을 가리키거나 같은 것을 두 번 가리키는 값은 거부되고 보드는 그대로 유지되므로, 도중에 카드가 사라지는 일이 없습니다. 값에서 빠진 항목은 자기 열에 남아, 값이 지정한 항목들 뒤에 놓입니다. - 이동 중의 변경. 항목을 옮기는 중에 값을 설정하거나
move를 호출하는 등 보드의 배치를 바꾸는 일이 생기면 진행 중인 이동을 먼저 취소합니다. - 안내 메시지. 집어 들기, 자리 선택, 놓기, 취소는 각각
kanban-status영역에서 항목의 이름, 열, 자리와 함께 안내합니다(예: "Price the annual plan: In review, position 1 of 1."). 페이지 언어로 안내하려면messages를 전달하세요. 항목은aria-label로, 없으면 항목에 담긴 첫 텍스트로 부르고, 열은 제목으로 부릅니다.
열의 순서는 마크업의 순서입니다. hidden이 있는 열은 항목을 받지 않으며 키보드로 열을 고를 때 건너뜁니다.
카드 안의 필드와 이동 폼 자체의 select도 폼 안에서와 마찬가지로 input과 change를 보드를 거쳐 내보냅니다. 이동에 따른 이벤트는 target이 보드인 이벤트입니다.
#이 동작이 측정하는 것
동작은 속성을 바꾸고 위치와 크기는 스타일시트에 맡깁니다. 스크롤되는 열을 가로지르는 드래그의 위치는 그런 방식으로 알아낼 수 없으므로, 이 동작만은 계약에 포함된 한도 안에서 측정을 합니다. 포인터가 열과 항목 사이 어디에 있는지 읽고, 끝 가까이에서 보드와 목록을 스크롤하며, 옮기는 시트에 사용자 지정 속성 세 개(--kanban-x, --kanban-y, --kanban-width)를 씁니다. 색상, 그림자, 그 밖의 스타일은 설정하지 않으며, 자리를 나타내는 표시는 스타일시트가 그리는 클래스입니다.
#키보드
| 키 | 동작 |
|---|---|
| Enter, Space | 핸들에서 항목을 집어 듭니다. 다시 누르면 선택한 자리에 항목을 놓습니다. |
| ArrowUp, ArrowDown | 항목이 놓일 열에서 앞이나 뒤의 자리를 선택합니다. |
| ArrowLeft, ArrowRight | 화면에 보이는 방향대로 옆의 열을 선택합니다. 오른쪽에서 왼쪽으로 읽는 레이아웃에서는 방향이 반대입니다. 자리는 그대로 유지되며, 열의 항목 수가 그보다 적으면 그 열의 마지막 자리가 됩니다. |
| Home, End | 그 열의 첫 번째 또는 마지막 자리를 선택합니다. |
| Escape | 항목을 원래 자리에 두고 포커스는 핸들에 유지합니다. 드래그 중이면 드래그를 끝냅니다. |
| Tab | 선택한 자리에 항목을 놓은 뒤, Tab 키의 기본 동작대로 핸들을 벗어납니다. |
#더 작은 보드
열과 카드는 보드의 사용자 지정 속성을 따릅니다. 여기서는 --kanban-column-width로 열을 좁혔고, 각 항목은 한 줄짜리 평평한 카드이며, 마지막 열은 비어 있습니다.
더 작은 보드
<div class="kanban" role="group" aria-label="Candidates" style="--kanban-column-width: 13rem"> <section class="kanban-column" data-value="applied" aria-labelledby="hiring-applied"> <header class="kanban-header"> <h3 class="kanban-title" id="hiring-applied">Applied</h3> </header> <ol class="kanban-items"> <li class="kanban-item" data-value="rivera"> <div class="card card-flat flex-row items-center gap-2xs"> <span class="grow(1) min-w(0) fg-text-strong">Dana Rivera</span> <span class="kanban-controls"> <button type="button" class="kanban-move" popovertarget="hiring-mover" aria-label="Move Dana Rivera"> <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.2559 2.3817A0.4996 0.4996 0 0 0 4.1667 2.6667L4.1673 13.3578A0.5 0.5 0 0 0 5.1613 13.4067L5.1667 13.3333L5.1653 2.6288A0.5007 0.5007 0 0 0 5.0775 2.3817A0.7044 0.7044 0 0 0 4.2559 2.3817Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M2.3333 5L4.5253 2.8081A0.2 0.2 0 0 1 4.8081 2.8081L7 5" transform="rotate(90 8 8)" /><path d="M11.8333 13.3333L11.8327 2.6422A0.5 0.5 0 0 0 10.8387 2.5933L10.8333 2.6667L10.8347 13.3712A0.5007 0.5007 0 0 0 10.9225 13.6183A0.7044 0.7044 0 0 0 11.7441 13.6183A0.4996 0.4996 0 0 0 11.8333 13.3333Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M9 11L11.1919 13.1919A0.2 0.2 0 0 0 11.4747 13.1919L13.6667 11" transform="rotate(90 8 8)" /> </svg> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Dana Rivera"> <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="6" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="12" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="12" r="1" fill="currentColor" stroke="none" /> </svg> </button> </span> </div> </li> <li class="kanban-item" data-value="okafor"> <div class="card card-flat flex-row items-center gap-2xs"> <span class="grow(1) min-w(0) fg-text-strong">Chidi Okafor</span> <span class="kanban-controls"> <button type="button" class="kanban-move" popovertarget="hiring-mover" aria-label="Move Chidi Okafor"> <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.2559 2.3817A0.4996 0.4996 0 0 0 4.1667 2.6667L4.1673 13.3578A0.5 0.5 0 0 0 5.1613 13.4067L5.1667 13.3333L5.1653 2.6288A0.5007 0.5007 0 0 0 5.0775 2.3817A0.7044 0.7044 0 0 0 4.2559 2.3817Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M2.3333 5L4.5253 2.8081A0.2 0.2 0 0 1 4.8081 2.8081L7 5" transform="rotate(90 8 8)" /><path d="M11.8333 13.3333L11.8327 2.6422A0.5 0.5 0 0 0 10.8387 2.5933L10.8333 2.6667L10.8347 13.3712A0.5007 0.5007 0 0 0 10.9225 13.6183A0.7044 0.7044 0 0 0 11.7441 13.6183A0.4996 0.4996 0 0 0 11.8333 13.3333Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M9 11L11.1919 13.1919A0.2 0.2 0 0 0 11.4747 13.1919L13.6667 11" transform="rotate(90 8 8)" /> </svg> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Chidi Okafor"> <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="6" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="12" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="12" r="1" fill="currentColor" stroke="none" /> </svg> </button> </span> </div> </li> <li class="kanban-item" data-value="sato"> <div class="card card-flat flex-row items-center gap-2xs"> <span class="grow(1) min-w(0) fg-text-strong">Hana Sato</span> <span class="kanban-controls"> <button type="button" class="kanban-move" popovertarget="hiring-mover" aria-label="Move Hana Sato"> <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.2559 2.3817A0.4996 0.4996 0 0 0 4.1667 2.6667L4.1673 13.3578A0.5 0.5 0 0 0 5.1613 13.4067L5.1667 13.3333L5.1653 2.6288A0.5007 0.5007 0 0 0 5.0775 2.3817A0.7044 0.7044 0 0 0 4.2559 2.3817Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M2.3333 5L4.5253 2.8081A0.2 0.2 0 0 1 4.8081 2.8081L7 5" transform="rotate(90 8 8)" /><path d="M11.8333 13.3333L11.8327 2.6422A0.5 0.5 0 0 0 10.8387 2.5933L10.8333 2.6667L10.8347 13.3712A0.5007 0.5007 0 0 0 10.9225 13.6183A0.7044 0.7044 0 0 0 11.7441 13.6183A0.4996 0.4996 0 0 0 11.8333 13.3333Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M9 11L11.1919 13.1919A0.2 0.2 0 0 0 11.4747 13.1919L13.6667 11" transform="rotate(90 8 8)" /> </svg> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Hana Sato"> <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="6" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="12" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="12" r="1" fill="currentColor" stroke="none" /> </svg> </button> </span> </div> </li> </ol> <p class="kanban-empty">No applicants</p> </section> <section class="kanban-column" data-value="interview" aria-labelledby="hiring-interview"> <header class="kanban-header"> <h3 class="kanban-title" id="hiring-interview">Interview</h3> </header> <ol class="kanban-items"> <li class="kanban-item" data-value="meyer"> <div class="card card-flat flex-row items-center gap-2xs"> <span class="grow(1) min-w(0) fg-text-strong">Lena Meyer</span> <span class="kanban-controls"> <button type="button" class="kanban-move" popovertarget="hiring-mover" aria-label="Move Lena Meyer"> <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.2559 2.3817A0.4996 0.4996 0 0 0 4.1667 2.6667L4.1673 13.3578A0.5 0.5 0 0 0 5.1613 13.4067L5.1667 13.3333L5.1653 2.6288A0.5007 0.5007 0 0 0 5.0775 2.3817A0.7044 0.7044 0 0 0 4.2559 2.3817Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M2.3333 5L4.5253 2.8081A0.2 0.2 0 0 1 4.8081 2.8081L7 5" transform="rotate(90 8 8)" /><path d="M11.8333 13.3333L11.8327 2.6422A0.5 0.5 0 0 0 10.8387 2.5933L10.8333 2.6667L10.8347 13.3712A0.5007 0.5007 0 0 0 10.9225 13.6183A0.7044 0.7044 0 0 0 11.7441 13.6183A0.4996 0.4996 0 0 0 11.8333 13.3333Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="rotate(90 8 8)" /><path d="M9 11L11.1919 13.1919A0.2 0.2 0 0 0 11.4747 13.1919L13.6667 11" transform="rotate(90 8 8)" /> </svg> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Lena Meyer"> <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="6" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="4" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="8" r="1" fill="currentColor" stroke="none" /><circle cx="6" cy="12" r="1" fill="currentColor" stroke="none" /><circle cx="10" cy="12" r="1" fill="currentColor" stroke="none" /> </svg> </button> </span> </div> </li> </ol> <p class="kanban-empty">No interviews</p> </section> <section class="kanban-column" data-value="offer" aria-labelledby="hiring-offer"> <header class="kanban-header"> <h3 class="kanban-title" id="hiring-offer">Offer</h3> </header> <ol class="kanban-items"></ol> <p class="kanban-empty">No offers yet</p> </section> <div class="popover popover-end" popover id="hiring-mover"> <form class="kanban-mover"> <label class="field">Column<select class="select" name="column"></select></label> <label class="field">Position<select class="select" name="position"></select></label> <div class="kanban-mover-actions"> <button type="button" class="btn btn-sm" popovertarget="hiring-mover" popovertargetaction="hide"> Cancel </button> <button type="submit" class="btn btn-sm btn-primary">Move</button> </div> </form> </div> <div class="kanban-preview" popover="manual" aria-hidden="true"></div> <p class="kanban-status" role="status"></p></div><script type="module"> import { attach } from '@master/ui/behaviors' attach()</script>import { useEffect, useRef } from 'react'import { attach } from '@master/ui/behaviors'import ArrowLeftRightIcon from '@master/icons-react/native/16/soft/arrow-left-right'import GripVerticalIcon from '@master/icons-react/native/16/soft/grip-vertical'export function Example() { const root = useRef<HTMLDivElement>(null) useEffect(() => attach(root.current!), []) return ( <div ref={root} className="kanban" role="group" aria-label="Candidates" style={{ '--kanban-column-width': '13rem' } as React.CSSProperties}> <section className="kanban-column" data-value="applied" aria-labelledby="hiring-applied"> <header className="kanban-header"> <h3 className="kanban-title" id="hiring-applied">Applied</h3> </header> <ol className="kanban-items"> <li className="kanban-item" data-value="rivera"> <div className="card card-flat flex-row items-center gap-2xs"> <span className="grow(1) min-w(0) fg-text-strong">Dana Rivera</span> <span className="kanban-controls"> <button type="button" className="kanban-move" popoverTarget="hiring-mover" aria-label="Move Dana Rivera"> <ArrowLeftRightIcon className="icon" /> </button> <button type="button" className="kanban-handle" aria-pressed="false" aria-label="Drag Dana Rivera"> <GripVerticalIcon className="icon" /> </button> </span> </div> </li> <li className="kanban-item" data-value="okafor"> <div className="card card-flat flex-row items-center gap-2xs"> <span className="grow(1) min-w(0) fg-text-strong">Chidi Okafor</span> <span className="kanban-controls"> <button type="button" className="kanban-move" popoverTarget="hiring-mover" aria-label="Move Chidi Okafor"> <ArrowLeftRightIcon className="icon" /> </button> <button type="button" className="kanban-handle" aria-pressed="false" aria-label="Drag Chidi Okafor"> <GripVerticalIcon className="icon" /> </button> </span> </div> </li> <li className="kanban-item" data-value="sato"> <div className="card card-flat flex-row items-center gap-2xs"> <span className="grow(1) min-w(0) fg-text-strong">Hana Sato</span> <span className="kanban-controls"> <button type="button" className="kanban-move" popoverTarget="hiring-mover" aria-label="Move Hana Sato"> <ArrowLeftRightIcon className="icon" /> </button> <button type="button" className="kanban-handle" aria-pressed="false" aria-label="Drag Hana Sato"> <GripVerticalIcon className="icon" /> </button> </span> </div> </li> </ol> <p className="kanban-empty">No applicants</p> </section> <section className="kanban-column" data-value="interview" aria-labelledby="hiring-interview"> <header className="kanban-header"> <h3 className="kanban-title" id="hiring-interview">Interview</h3> </header> <ol className="kanban-items"> <li className="kanban-item" data-value="meyer"> <div className="card card-flat flex-row items-center gap-2xs"> <span className="grow(1) min-w(0) fg-text-strong">Lena Meyer</span> <span className="kanban-controls"> <button type="button" className="kanban-move" popoverTarget="hiring-mover" aria-label="Move Lena Meyer"> <ArrowLeftRightIcon className="icon" /> </button> <button type="button" className="kanban-handle" aria-pressed="false" aria-label="Drag Lena Meyer"> <GripVerticalIcon className="icon" /> </button> </span> </div> </li> </ol> <p className="kanban-empty">No interviews</p> </section> <section className="kanban-column" data-value="offer" aria-labelledby="hiring-offer"> <header className="kanban-header"> <h3 className="kanban-title" id="hiring-offer">Offer</h3> </header> <ol className="kanban-items"></ol> <p className="kanban-empty">No offers yet</p> </section> <div className="popover popover-end" popover="" id="hiring-mover"> <form className="kanban-mover"> <label className="field">Column<select className="select" name="column"></select></label> <label className="field">Position<select className="select" name="position"></select></label> <div className="kanban-mover-actions"> <button type="button" className="btn btn-sm" popoverTarget="hiring-mover" popoverTargetAction="hide"> Cancel </button> <button type="submit" className="btn btn-sm btn-primary">Move</button> </div> </form> </div> <div className="kanban-preview" popover="manual" aria-hidden="true"></div> <p className="kanban-status" role="status"></p> </div> )}<script> import { attach } from '@master/ui/behaviors' import ArrowLeftRightIcon from '@master/icons-svelte/native/16/soft/arrow-left-right' import GripVerticalIcon from '@master/icons-svelte/native/16/soft/grip-vertical'</script><div class="kanban" role="group" aria-label="Candidates" style="--kanban-column-width: 13rem" {@attach attach}> <section class="kanban-column" data-value="applied" aria-labelledby="hiring-applied"> <header class="kanban-header"> <h3 class="kanban-title" id="hiring-applied">Applied</h3> </header> <ol class="kanban-items"> <li class="kanban-item" data-value="rivera"> <div class="card card-flat flex-row items-center gap-2xs"> <span class="grow(1) min-w(0) fg-text-strong">Dana Rivera</span> <span class="kanban-controls"> <button type="button" class="kanban-move" popovertarget="hiring-mover" aria-label="Move Dana Rivera"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Dana Rivera"> <GripVerticalIcon class="icon" /> </button> </span> </div> </li> <li class="kanban-item" data-value="okafor"> <div class="card card-flat flex-row items-center gap-2xs"> <span class="grow(1) min-w(0) fg-text-strong">Chidi Okafor</span> <span class="kanban-controls"> <button type="button" class="kanban-move" popovertarget="hiring-mover" aria-label="Move Chidi Okafor"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Chidi Okafor"> <GripVerticalIcon class="icon" /> </button> </span> </div> </li> <li class="kanban-item" data-value="sato"> <div class="card card-flat flex-row items-center gap-2xs"> <span class="grow(1) min-w(0) fg-text-strong">Hana Sato</span> <span class="kanban-controls"> <button type="button" class="kanban-move" popovertarget="hiring-mover" aria-label="Move Hana Sato"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Hana Sato"> <GripVerticalIcon class="icon" /> </button> </span> </div> </li> </ol> <p class="kanban-empty">No applicants</p> </section> <section class="kanban-column" data-value="interview" aria-labelledby="hiring-interview"> <header class="kanban-header"> <h3 class="kanban-title" id="hiring-interview">Interview</h3> </header> <ol class="kanban-items"> <li class="kanban-item" data-value="meyer"> <div class="card card-flat flex-row items-center gap-2xs"> <span class="grow(1) min-w(0) fg-text-strong">Lena Meyer</span> <span class="kanban-controls"> <button type="button" class="kanban-move" popovertarget="hiring-mover" aria-label="Move Lena Meyer"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Lena Meyer"> <GripVerticalIcon class="icon" /> </button> </span> </div> </li> </ol> <p class="kanban-empty">No interviews</p> </section> <section class="kanban-column" data-value="offer" aria-labelledby="hiring-offer"> <header class="kanban-header"> <h3 class="kanban-title" id="hiring-offer">Offer</h3> </header> <ol class="kanban-items"></ol> <p class="kanban-empty">No offers yet</p> </section> <div class="popover popover-end" popover id="hiring-mover"> <form class="kanban-mover"> <label class="field">Column<select class="select" name="column"></select></label> <label class="field">Position<select class="select" name="position"></select></label> <div class="kanban-mover-actions"> <button type="button" class="btn btn-sm" popovertarget="hiring-mover" popovertargetaction="hide"> Cancel </button> <button type="submit" class="btn btn-sm btn-primary">Move</button> </div> </form> </div> <div class="kanban-preview" popover="manual" aria-hidden="true"></div> <p class="kanban-status" role="status"></p></div><script setup>import { onMounted, onUnmounted, ref } from 'vue'import { attach } from '@master/ui/behaviors'import ArrowLeftRightIcon from '@master/icons-vue/native/16/soft/arrow-left-right'import GripVerticalIcon from '@master/icons-vue/native/16/soft/grip-vertical'const root = ref(null)let detachonMounted(() => { detach = attach(root.value) })onUnmounted(() => detach?.())</script><template> <div ref="root" class="kanban" role="group" aria-label="Candidates" style="--kanban-column-width: 13rem"> <section class="kanban-column" data-value="applied" aria-labelledby="hiring-applied"> <header class="kanban-header"> <h3 class="kanban-title" id="hiring-applied">Applied</h3> </header> <ol class="kanban-items"> <li class="kanban-item" data-value="rivera"> <div class="card card-flat flex-row items-center gap-2xs"> <span class="grow(1) min-w(0) fg-text-strong">Dana Rivera</span> <span class="kanban-controls"> <button type="button" class="kanban-move" popovertarget="hiring-mover" aria-label="Move Dana Rivera"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Dana Rivera"> <GripVerticalIcon class="icon" /> </button> </span> </div> </li> <li class="kanban-item" data-value="okafor"> <div class="card card-flat flex-row items-center gap-2xs"> <span class="grow(1) min-w(0) fg-text-strong">Chidi Okafor</span> <span class="kanban-controls"> <button type="button" class="kanban-move" popovertarget="hiring-mover" aria-label="Move Chidi Okafor"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Chidi Okafor"> <GripVerticalIcon class="icon" /> </button> </span> </div> </li> <li class="kanban-item" data-value="sato"> <div class="card card-flat flex-row items-center gap-2xs"> <span class="grow(1) min-w(0) fg-text-strong">Hana Sato</span> <span class="kanban-controls"> <button type="button" class="kanban-move" popovertarget="hiring-mover" aria-label="Move Hana Sato"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Hana Sato"> <GripVerticalIcon class="icon" /> </button> </span> </div> </li> </ol> <p class="kanban-empty">No applicants</p> </section> <section class="kanban-column" data-value="interview" aria-labelledby="hiring-interview"> <header class="kanban-header"> <h3 class="kanban-title" id="hiring-interview">Interview</h3> </header> <ol class="kanban-items"> <li class="kanban-item" data-value="meyer"> <div class="card card-flat flex-row items-center gap-2xs"> <span class="grow(1) min-w(0) fg-text-strong">Lena Meyer</span> <span class="kanban-controls"> <button type="button" class="kanban-move" popovertarget="hiring-mover" aria-label="Move Lena Meyer"> <ArrowLeftRightIcon class="icon" /> </button> <button type="button" class="kanban-handle" aria-pressed="false" aria-label="Drag Lena Meyer"> <GripVerticalIcon class="icon" /> </button> </span> </div> </li> </ol> <p class="kanban-empty">No interviews</p> </section> <section class="kanban-column" data-value="offer" aria-labelledby="hiring-offer"> <header class="kanban-header"> <h3 class="kanban-title" id="hiring-offer">Offer</h3> </header> <ol class="kanban-items"></ol> <p class="kanban-empty">No offers yet</p> </section> <div class="popover popover-end" popover id="hiring-mover"> <form class="kanban-mover"> <label class="field">Column<select class="select" name="column"></select></label> <label class="field">Position<select class="select" name="position"></select></label> <div class="kanban-mover-actions"> <button type="button" class="btn btn-sm" popovertarget="hiring-mover" popovertargetaction="hide"> Cancel </button> <button type="submit" class="btn btn-sm btn-primary">Move</button> </div> </form> </div> <div class="kanban-preview" popover="manual" aria-hidden="true"></div> <p class="kanban-status" role="status"></p> </div></template>#스크립트 없이
보드는 섹션, 제목, 목록으로 이루어지므로 동작이 없어도 열 단위로 순서대로 읽히고 스크롤됩니다. 다만 아무것도 옮길 수 없습니다. 옮기려면 동작이 있거나 페이지가 순서를 직접 써야 합니다. 아무 일도 하지 않는 핸들과 이동 버튼은 없는 것만 못하므로, 스크립트 없이 실행될 수 있는 페이지에서는 스크립트가 준비된 뒤에 이 둘을 렌더링하세요.
팝오버 API가 없는 브라우저에서는 드래그하는 동안 포인터를 따라가는 것이 없습니다. 그래도 흐려진 항목과 선이 무엇을 옮기는지, 어디에 놓일지를 알려 줍니다.
#접근성
- 각 열은 제목으로 이름을 지정한
<section>이므로 스크린 리더가 바로 이동할 수 있는 영역이 되고, 항목은 개수를 알려 주는 네이티브 목록입니다. 보드는 이름이 있는role="group"입니다. - 드래그가 유일한 방법이 되는 일은 없습니다. 포인터로 할 수 있는 일은 키보드로 모두 할 수 있고, 이동 폼은 select 두 개와 버튼 하나로 같은 일을 합니다. 이것이 WCAG 2.5.7의 요구 사항입니다. 키보드 대안만으로는 터치를 사용하면서 드래그할 수 없는 사용자에게 닿지 못합니다.
- 두 컨트롤의 이름에는 무엇을 옮기는지 밝히세요(예: "Drag Price the annual plan", "Move Price the annual plan").
- 상태 영역은 처음부터 비어 있는 상태로 페이지에 두세요. 안내하는 순간에 추가한 영역은 스크린 리더가 읽지 못하는 경우가 많습니다.
- 이동 후에는 옮긴 항목의 핸들에 포커스가 있고 항목이 화면에 보입니다. Tab 키로 핸들을 벗어나면 이동이 확정되며 포커스를 다시 끌어오지 않습니다.
- 배치는 페이지에서 다른 데이터를 저장하는 방식과 같은 방식으로
change에서 저장하세요. 이동에 사용자가 볼 수 없는 효과가 있다면 보드 근처에 그 사실을 알리세요.
#React, Svelte, Vue
kanban 컴포넌트는 columns, items, 그리고 자신이 가진 배치로 열과 항목을 작성하고, 두 버튼의 속성을 항목의 마크업에 넘겨 스프레드하게 하며, 동작을 연결합니다. 이동이 확정되면 동작은 그릴 배치를 컴포넌트에 넘기고, 그 렌더링을 기다린 뒤에 포커스를 되돌리고 이벤트를 발생시킵니다. 컴포넌트를 쓰는 쪽이 그 배치를 받아들이지 않으면 보드는 그대로 유지됩니다. npx master-ui add kanban 명령을 실행해 프로젝트에 복사하세요. 컴포넌트의 구성과 사용 방법은 React, Svelte, Vue에서 확인할 수 있습니다.
열이 바뀐 항목은 새 목록에서 다시 렌더링됩니다. 프레임워크가 부모가 바뀐 항목을 렌더링하는 방식과 같습니다. 카드에 표시하는 내용은 카드 내부의 상태가 아니라 데이터에 두세요.
#클래스
| 클래스 | 설명 |
|---|---|
kanban | 보드입니다. 가로로 스크롤되는 열의 행입니다. 높이를 지정하면 열이 그 높이에서 멈추고 각 목록이 독립적으로 스크롤됩니다. 항목을 옮기는 동안 커서가 주먹 쥔 손 모양으로 바뀝니다. |
kanban-column | 열입니다. 제목으로 이름을 지정한 트레이이며 data-value 값을 나타냅니다. hidden이 있으면 항목을 받지 않고 건너뜁니다. |
kanban-header | 열의 머리 부분으로, 제목과 개수처럼 그 옆에 놓이는 요소를 담습니다. 목록이 스크롤되는 동안 제자리에 남습니다. |
kanban-title | 열의 이름입니다. 항목의 텍스트가 시작하는 선에 맞춰 놓입니다. |
kanban-items | 열의 목록으로, 문서 순서를 따릅니다. 열에서 스크롤되는 부분입니다. |
kanban-items-target | 옮기는 항목이 놓일 자리가 목록의 끝일 때 동작이 그 목록에 설정합니다. 마지막 항목 뒤에 선을 그리거나, 빈 열의 오목한 영역 둘레에 링을 그립니다.적용할 클래스는 kanban-items입니다 |
kanban-item | 항목입니다. data-value 값을 나타내며, 이 값은 보드의 다른 항목과 겹치지 않습니다. 옮기는 동안에는 제자리에 남아 흐려집니다. 마우스로는 링크, 버튼, 필드가 아닌 어느 부분으로든 옮길 수 있습니다. |
kanban-item-target | 옮기는 항목이 어떤 항목 앞에 놓이게 될 때 동작이 그 항목에 설정합니다. 그 항목 위쪽 간격에 선을 그립니다.적용할 클래스는 kanban-item입니다 |
kanban-handle | 항목을 옮기는 버튼으로, 손잡이 아이콘을 넣습니다. 무엇을 옮기는지 이름으로 밝히세요. 조작 영역은 24px이고 터치 화면에서는 높이가 44px이며 옆의 이동 버튼과의 중간까지만 넓어집니다. |
kanban-controls | 항목의 이동 버튼과 핸들을 한 쌍으로 묶어 항목 첫 줄의 끝에 두는 요소입니다. 둘은 가까이 붙어 놓이고, 항목의 패딩 안으로 걸쳐 들어가 손잡이의 글리프가 그 아래 텍스트가 끝나는 가장자리에 맞으며, 높이가 --kanban-line인 줄을 기준으로 세로 가운데에 놓입니다. |
kanban-move | 해당 항목의 이동 폼을 여는 버튼으로, 손잡이와 한 쌍을 이루며, 서로 엇갈리는 화살표 두 개의 아이콘을 넣습니다. 조작 영역은 24px이고 터치 화면에서는 높이가 44px이며 손잡이와의 중간까지만 넓어집니다. popovertarget으로 이동 폼의 팝오버를 지정하고, 무엇을 옮기는지 이름으로 밝히세요. 포인터를 올릴 수 있는 기기에서는 포인터나 키보드가 해당 항목에 닿은 뒤에 그립니다. |
kanban-empty | 얕은 오목한 영역 안의 짧은 문구입니다. 열에 항목이 없는 동안 목록 대신 표시됩니다. |
kanban-preview | 동작이 드래그하는 동안 최상위 레이어에서 포인터 위치에 표시하는 빈 요소로, 옮기는 항목의 이름을 담습니다. |
kanban-preview-landing | 포인터를 놓은 뒤 시트가 항목이 들어간 자리로 미끄러지듯 이동하는 동안 동작이 설정합니다.적용할 클래스는 kanban-preview입니다 |
kanban-mover | 보드 안에 있는 팝오버의 폼입니다. 이름이 column인 select와 이름이 position인 select가 있으며, 동작이 이 둘을 채웁니다. 항목 안의 버튼 가운데 popovertarget이 그 팝오버인 버튼, 즉 kanban-move나 페이지가 직접 만든 버튼이 해당 항목에 대한 폼을 열고, 폼을 제출하면 항목이 이동합니다. 동작은 해당 버튼의 이름을 폼의 aria-label로 지정하여 어떤 항목을 이동하는지 알립니다. |
kanban-mover-actions | 이동 폼 끝에 놓이는 버튼들입니다. 폼을 닫는 버튼이 먼저, 이동하는 버튼이 그다음에 옵니다. |
kanban-status | 집어 들기, 자리 선택, 놓기, 취소를 각각 안내하는 영역으로, 보드 안이나 바로 뒤에 둡니다. 공간을 차지하지 않습니다. |
#사용자 지정 속성
| 속성 | 기본값 | 설명 |
|---|---|---|
--kanban-column-width | 17.5rem | 열의 너비입니다. 보드 너비에서 2rem을 뺀 값을 넘지 않습니다. |
--kanban-gap | .75rem | 두 열 사이의 간격 |
--kanban-inset | .375rem | 열의 가장자리와 항목 사이의 여백입니다. 열의 모서리 반경은 항목의 모서리 반경에 이 값을 더한 값입니다. |
--kanban-item-gap | .375rem | 두 항목 사이의 간격으로, 자리를 표시하는 선이 여기에 놓입니다. |
--kanban-padding | .75rem | 보드에 담긴 카드의 패딩입니다. 열의 제목도 같은 선에서 시작합니다. |
--kanban-radius | var(--radius-control-lg) | 보드에 담긴 카드, 빈 열의 오목한 영역, 옮기는 시트의 모서리 반경 |
--kanban-marker | var(--color-focus) | 자리를 표시하는 선과 빈 열 둘레에 그리는 링의 색 |
--kanban-line | calc(.9375rem * 1.4) | 컨트롤 한 쌍이 세로 가운데로 정렬되는 줄의 높이입니다. 기본값은 카드 제목의 줄 높이입니다.kanban-controls에 설정합니다 |
--kanban-x | 뷰포트 왼쪽을 기준으로 한 옮기는 시트의 시작 가장자리 위치이며, 스크립트가 값을 기록합니다.kanban-preview에 설정합니다 | |
--kanban-y | 뷰포트 위쪽을 기준으로 한 옮기는 시트의 위쪽 가장자리 위치이며, 스크립트가 값을 기록합니다.kanban-preview에 설정합니다 | |
--kanban-width | 옮기는 시트의 너비로, 옮기는 항목의 너비와 같습니다. 스크립트가 값을 기록합니다.kanban-preview에 설정합니다 |
#관련 항목
- 정렬 가능 목록핸들을 드래그하거나 키보드로 항목의 순서를 정하는 목록입니다.
- 카드카드에 주어진 공간에 따라 내부 배치가 달라지는, 살짝 떠 있는 시트입니다.
- 팝오버팝오버를 여는 버튼을 기준으로 배치되는 떠 있는 패널입니다.
- 셀렉트인터페이스의 다른 부분과 같은 표면 스타일로 옵션 목록을 표시하는 네이티브 셀렉트입니다.
- 스크롤 영역콘텐츠가 이어지는 가장자리에 페이드가 적용되는 스크롤 영역입니다.