Kanban
A board of columns whose items are moved within a column or into another, by dragging, with the keys or by choosing a place.
On this page
A kanban is a board of columns, each a named section that holds a list, where an item is moved to another place in its column or into another column. Each item has two small controls: a handle that carries it with the pointer or the keys, and a button that opens the mover, where a column and a position are chosen without a drag. What an item shows is the page's own: here a card with a badge and an avatar. The kanban behavior does the moving; nothing moves until a move is committed.
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>A sortable puts one list in order. Use a kanban when an item also changes list, and the list it is in says something about it: its stage, its owner, its state.
#What the stylesheet draws
- The board is a row that scrolls across. Give it a height, as the
h(376)above does or as the main region of the board page does, and its columns stop there. - A column is a tray: recessed by tone and a hairline, as wide as
--kanban-column-widthand never wider than the board less 2rem, so on a phone the next column shows at the edge. It is as tall as what it holds. Its list,kanban-items, is the one part that scrolls, under a header that stays. - One corner, one line. A card the board holds takes
--kanban-radiusand--kanban-padding. A column's corner is that radius plus--kanban-inset, the room around its items, and its title starts on the line the cards' words start on. - The two controls are a pair, 24px each and 44px tall to a finger, each target stopping halfway to the other so neither answers for its neighbor: the handle, which holds a grip icon, and
kanban-move, which holds two arrows that pass, each a Master Icons drawing in the markup. Both show only their icon until the pointer or the keys reach them. Only the handle takestouch-action: none, so a swipe that starts anywhere else on a card still scrolls.kanban-controlsholds the pair at the end of an item's first line: it hangs into the card's padding by .5rem, as far as the grip's points stand in from its box, so the grip meets the edge the avatar under it ends on, and it centers on the title's first line. - The move button waits. Where a pointer hovers,
kanban-moveis not drawn until the pointer or the keys are on its item, so a board shows one grip to a card; on a touch screen it is always drawn. - Carried, an item keeps its place and fades, so the reader sees where it came from, and its grip sits in a well.
- The place it would land in is a line in the middle of the gap, drawn before an item marked
kanban-item-targetor after the last item of a list markedkanban-items-target. No item makes room: the board holds still under the pointer, which is what keeps the place from chasing itself. - An empty column shows
kanban-empty, a few words in a shallow well, in place of its list. As the place an item would land in, the well takes the marker's ink as a ring. - The carried sheet,
kanban-preview, is the item's name on a small raised sheet at the item's width. It is a manual popover, so it stands in the top layer, where no column's scrolling clips it, and it holds no copy of the card: no second id, field or picture. On the release it glides to the place the item took and leaves.
With reduced motion the sheet does not glide and the item does not fade in. In forced colors the columns, the well and the sheet are outlined and the line is drawn in the system's highlight.
#The behavior
kanban takes the root, the element with the kanban class, and returns the function that detaches it.
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)})- The pointer. A press on a handle that moves more than 4px picks the item up; mouse, pen and touch alike, and only the pointer that started the drag moves it. The column under the pointer, or the nearest one across, is where it would land, before the first item whose middle is under the pointer. The board is scrolled across, and that column's list along, while the pointer is near their ends. The release commits. A release where the item was picked up changes nothing, and a release outside the board, Escape, a cancelled pointer and a capture taken away all leave it where it was.
- The whole item, for a mouse. A mouse also picks an item up by any part of it that is not a link, a button or a field, and the item shows the hand there. A finger carries by the handle alone: a press anywhere else on an item is how the list is scrolled. A press on the item that does not move is still only a click on whatever it is over.
- The keys. Enter or Space on a handle picks the item up, as a press that does not move does. The arrow keys then choose a place, which the line shows; they do nothing until an item is picked up, so a screen reader's own arrow keys keep working. Enter or Space commits, Escape cancels, and leaving the handle commits too.
- The mover. A button in an item whose
popovertargetis the popover that holds the formkanban-moveropens it for that item. The browser opens and closes the popover; the behavior writes the columns into the select namedcolumnand the places of the chosen column into the select namedposition, and submitting the form commits. This is the way for a hand that cannot drag and has no keyboard, and for a screen reader on a touch screen. - One path. The pointer, the keys and the mover all commit through
move(item, column, index), which is also there to call.indexis the place among the column's other items:0is first, and a number past the end is the end. A commit that changes the board moves the item's node itself, withmoveBefore()where the browser has it so a field's text and focus stay, brings the item into view, gives focus to its handle and dispatches. A commit to the place the item is in dispatches nothing. - The move is drawn. Where the browser has view transitions scoped to an element, a commit starts one on the board: every item glides to the place it now has, clipped by its list, and the commit is finished a frame later, so
movethen answers with a promise. Elsewhere, and with reduced motion, the items take their places at once. The glide takes 160ms and the board takes no press while it lasts. - What the page moves.
movecalled by the page does not bring the item into view or move focus, does not move into a hidden column, and is refused while an earlier move is still being drawn. An item whose handle isdisabledstays where it is by every way, the mover included. - The value is the arrangement: one
{ value, items }to a column, in the order of the columns. It is what has been committed, never the place being chosen. Set it to arrange the board; that dispatches nothing. A value that names a column or an item the board does not have, or names one twice, is refused and the board stays as it is, so a card is never dropped on the way. An item the value leaves out keeps its column, after the ones it names. - Under a move. Setting the value, calling
move, or anything else that rearranges the board while an item is carried cancels that move first. - What it says. Each pick, place, drop and cancel is said in the
kanban-statusregion with the item's name, the column and the place: "Price the annual plan: In review, position 1 of 1." Passmessagesto say it in the page's language. An item is called by itsaria-label, or by the first words it holds, and a column by its title.
The order of the columns is the markup's. A column with hidden takes no item and the keys pass over it.
Fields inside the cards and the mover's own selects send input and change through the board too, as they would through a form. A move's events are the ones whose target is the board.
#What this behavior measures
A behavior moves attributes and leaves geometry to the stylesheet. A drag across scrolling columns cannot be found that way, so this one behavior measures, within limits that are part of its contract: it reads where the pointer is among the columns and the items, scrolls the board and a list near their ends, and writes three custom properties on the carried sheet, --kanban-x, --kanban-y and --kanban-width. It sets no color, no shadow and no other style, and the marks of a place are classes the stylesheet draws.
#Keyboard
| Keys | Action |
|---|---|
| Enter, Space | On a handle, pick the item up; again, drop it in the place chosen |
| ArrowUp, ArrowDown | Choose the place before or after, in the column the item would land in |
| ArrowLeft, ArrowRight | Choose the column beside it, as it is seen: the other way around from right to left. The place stays, or is the column's last when it has fewer |
| Home, End | Choose the first or the last place of that column |
| Escape | Leave the item where it was and keep focus on its handle; during a drag, end the drag |
| Tab | Drop the item in the place chosen, then leave the handle as Tab does |
#A smaller board
The columns and the cards answer to the board's custom properties. Here --kanban-column-width narrows the columns and each item is a flat card with one line, and the last column is empty.
A smaller board
<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>#Without the script
The board is sections, headings and lists, so without the behavior it reads in order, column by column, and scrolls. Nothing can be moved: moving needs the behavior, or a page that writes the order itself. A handle and a move button that do nothing are worse than none, so a page that may run without script renders them once the script is there.
Where a browser has no popover API, nothing follows the pointer during a drag; the faded item and the line still say what is carried and where it would land.
#Accessibility
- Each column is a
<section>named by its title, so it is a region a screen reader can jump to, and its items are a native list that says how many it holds. The board is arole="group"with a name. - Dragging is never the only way. The keys do everything the pointer does, and the mover does it with two selects and a button, which is what WCAG 2.5.7 asks for: a keyboard alternative alone does not reach a reader who uses touch and cannot drag.
- Name both controls with what they move: "Drag Price the annual plan", "Move Price the annual plan".
- Keep the status region in the page from the start, empty: a region added at the moment it speaks is often not heard.
- After a move focus is on the handle of the item that moved, and the item is in view. Leaving the handle with Tab commits and does not pull focus back.
- Save the arrangement the way the page saves anything else, on
change; say so near the board when a move has an effect a reader cannot see.
#React, Svelte and Vue
The kanban component writes the columns and their items from columns, items and the arrangement it holds, hands an item's markup the attributes of its two buttons to spread, and attaches the behavior. When a move is committed the behavior gives the component the arrangement to draw and waits for that render before it returns focus and dispatches; an owner that does not take the arrangement leaves the board as it was. Copy it into the project with npx master-ui add kanban; React, Svelte and Vue says how the components are built and used.
An item that changes column is rendered again in its new list, as a framework renders any item that changes parent. Keep what a card shows in your data rather than in state inside the card.
#Classes
| Class | Description |
|---|---|
kanban | The board: a row of columns that scrolls across. Give it a height and its columns stop there, each list scrolling by itself. While an item is carried the cursor is a closed hand |
kanban-column | A column, a tray named by its title. It stands for its data-value. With hidden it takes no item and is passed over |
kanban-header | The head of a column: its title and whatever stands beside it, such as a count. It stays while the list scrolls |
kanban-title | The column's name, on the line the items' words start on |
kanban-items | The list of a column, in the order of the document. It is the part that scrolls |
kanban-items-target | Set by the behavior on the list whose end is the place the carried item would land in: a line after its last item, or a ring around the well of an empty columnApply with kanban-items |
kanban-item | An item. It stands for its data-value, which no other item of the board has. Carried, it keeps its place and fades. A mouse carries it by any part that is not a link, a button or a field |
kanban-item-target | Set by the behavior on the item the carried one would land before: a line in the gap over itApply with kanban-item |
kanban-handle | The button that carries the item, holding a grip icon: name it with what it moves. A 24px target, 44px tall on touch screens, that stops halfway to the move button beside it |
kanban-controls | What holds an item's move button and its handle as a pair at the end of its first line: they stand close, hang into the item's padding so the grip's glyph meets the edge the words under it end on, and center on a line of --kanban-line |
kanban-move | The button that opens the mover for its item, the grip's pair, holding an icon of two arrows that pass: a 24px target, 44px tall on touch screens, that stops halfway to the grip. Give it the popovertarget of the mover's popover and name it with what it moves. Where a pointer hovers it is drawn once the pointer or the keys are on its item |
kanban-empty | A few words in a shallow well, shown in place of the list while the column holds no item |
kanban-preview | An empty element the behavior shows in the top layer during a drag, with the carried item's name, at the pointer |
kanban-preview-landing | Set by the behavior after the release, while the sheet glides to the place the item tookApply with kanban-preview |
kanban-mover | The form of a popover in the board, with a select named column and a select named position, which the behavior fills. A button in an item whose popovertarget is that popover, kanban-move or one of the page's own, opens it for the item; submitting it moves the item. The behavior gives the form that button's name as its aria-label, so it says which item it moves |
kanban-mover-actions | The mover's buttons, at its end: the one that closes it, then the one that moves |
kanban-status | A region that says each pick, place, drop and cancel, inside the board or right after it. It takes no room |
#Custom properties
| Property | Default | Description |
|---|---|---|
--kanban-column-width | 17.5rem | The width of a column, which is never wider than the board less 2rem |
--kanban-gap | .75rem | The room between two columns |
--kanban-inset | .375rem | The room between a column's edge and its items; the column's corner is the items' corner plus it |
--kanban-item-gap | .375rem | The room between two items, where the line of a place stands |
--kanban-padding | .75rem | The padding of a card the board holds; a column's title starts on the same line |
--kanban-radius | var(--radius-control-lg) | The corner of a card the board holds, of an empty column's well and of the carried sheet |
--kanban-marker | var(--color-focus) | The ink of the line, and of the ring around an empty column, that marks a place |
--kanban-line | calc(.9375rem * 1.4) | The height of the line the pair of controls centers on: a card title's by defaultSet on kanban-controls |
--kanban-x | Where the carried sheet's start edge is, from the viewport's left; the script writes itSet on kanban-preview | |
--kanban-y | Where the carried sheet's top is, from the viewport's top; the script writes itSet on kanban-preview | |
--kanban-width | The width of the carried sheet, the carried item's own; the script writes itSet on kanban-preview |
#Related
- SortableA list whose items are put in order by dragging a handle or with the keys.
- CardA raised sheet whose parts follow the room the card is given.
- PopoverA floating sheet anchored to the button that opens it.
- SelectA native select whose option list is drawn in the same material.
- Scroll areaA scrolling region whose edges fade where content continues.