Navigation

v2.1.0
Structure

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>
Drag a grip to another column: a line marks where the card would land, and the board scrolls while the pointer is near an end. With the keys, focus a grip, press Space, choose a place with the arrow keys and press Space again. The button beside the grip moves the card without a drag.

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-width and 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-radius and --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 takes touch-action: none, so a swipe that starts anywhere else on a card still scrolls. kanban-controls holds 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-move is 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-target or after the last item of a list marked kanban-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.

app.js
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 popovertarget is the popover that holds the form kanban-mover opens it for that item. The browser opens and closes the popover; the behavior writes the columns into the select named column and the places of the chosen column into the select named position, 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. index is the place among the column's other items: 0 is first, and a number past the end is the end. A commit that changes the board moves the item's node itself, with moveBefore() 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 move then 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. move called 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 is disabled stays 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-status region with the item's name, the column and the place: "Price the annual plan: In review, position 1 of 1." Pass messages to say it in the page's language. An item is called by its aria-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

KeysAction
Enter, SpaceOn a handle, pick the item up; again, drop it in the place chosen
ArrowUp, ArrowDownChoose the place before or after, in the column the item would land in
ArrowLeft, ArrowRightChoose 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, EndChoose the first or the last place of that column
EscapeLeave the item where it was and keep focus on its handle; during a drag, end the drag
TabDrop 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 a role="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.

ui/kanban.tsx
'use client'import { useId, useLayoutEffect, useRef, useState, type ComponentProps, type ReactNode } from 'react'import { kanban, type KanbanMessages, type KanbanValue } from '@master/ui/behaviors/kanban.js'import { useBehavior } from './use-behavior'export type { KanbanValue }export interface KanbanColumn {  /** What the column stands for in the arrangement. */  value: string  /** The column's name: its title, and what the status and the mover call it. */  label: string}export interface KanbanItem {  /** What the item stands for in the arrangement. No other item has it. */  value: string  /** What the item is called: its handle and its move button are named with it. */  label: string  /** The column the item starts in, and stays in while the arrangement does not name it. The first by default. */  column?: string}export interface KanbanLabels<T extends KanbanItem> {  /** The accessible name of an item's handle. `Drag <label>` by default. */  drag?: (item: T) => string  /** The accessible name of the button that opens the mover for an item. `Move <label>` by default. */  move?: (item: T) => string  /** The mover's two fields and two buttons. */  column?: string  position?: string  confirm?: string  cancel?: string}/** What an item's own markup spreads on its two buttons. */export interface KanbanControls {  /** For the grip, an empty `<button>`: it carries the item with the pointer and the keys. */  handle: ComponentProps<'button'>  /** For the button that opens the mover, an empty `<button>`: a column and a position are chosen there. */  move: ComponentProps<'button'>}export interface KanbanProps<C extends KanbanColumn, T extends KanbanItem> extends Omit<ComponentProps<'div'>, 'children' | 'defaultValue' | 'ref'> {  /** The columns, in their order. The order is not the reader's to change. */  columns: C[]  items: T[]  /** The arrangement: each column's value and the values of its items, in order. */  value?: KanbanValue  defaultValue?: KanbanValue  onValueChange?: (value: KanbanValue) => void  /** What an item shows, with the attributes of its handle and of its move button to spread. Each button holds its icon. */  children: (item: T, controls: KanbanControls) => ReactNode  /** What stands beside a column's title, such as the number of items it holds. */  header?: (column: C, items: T[]) => ReactNode  /** What a column says while it holds no item. */  empty?: (column: C) => ReactNode  /** The names of the controls, in the page's language. */  labels?: KanbanLabels<T>  /** What the status region says, in the page's language. */  messages?: KanbanMessages}/** * A board whose items the reader moves between columns. React writes the columns and their items in the * arrangement it holds; the behavior carries an item with the pointer and the keys, and asks React to arrange * the board when one is dropped. An item that changes column is rendered again in its new list, so what it * shows comes from the data, not from state kept inside it. */export function Kanban<C extends KanbanColumn, T extends KanbanItem>({ columns, items, value, defaultValue, onValueChange, children, header, empty, labels = {}, messages, className, ...root }: KanbanProps<C, T>) {  const id = useId()  const [kept, setKept] = useState(() => value ?? defaultValue)  const shown = arranged(columns, items, value ?? kept)  // A move waits for the render that writes the item in its place, so focus finds its handle there. Every  // arrangement asked for is kept, which renders even when the owner does not take it: the wait always ends.  const waiting = useRef<(() => void)[]>([])  useLayoutEffect(() => {    waiting.current.splice(0).forEach(done => done())  })  const arrange = (next: KanbanValue) => new Promise<void>((done) => {    waiting.current.push(done)    setKept(next)    onValueChange?.(next)  })  const ref = useBehavior(kanban, { messages, arrange })  const { drag = (item: T) => `Drag ${item.label}`, move = (item: T) => `Move ${item.label}`, column: columnLabel = 'Column', position = 'Position', confirm = 'Move', cancel = 'Cancel' } = labels  return (    <div className={className ? `kanban ${className}` : 'kanban'} role="group" ref={ref} {...root}>      {columns.map((column, at) => (        <section className="kanban-column" data-value={column.value} aria-labelledby={`${id}-column-${at}`} key={column.value}>          <header className="kanban-header">            <h3 className="kanban-title" id={`${id}-column-${at}`}>{column.label}</h3>            {header?.(column, shown[at]!)}          </header>          <ol className="kanban-items">            {shown[at]!.map(item => (              <li className="kanban-item" data-value={item.value} key={item.value}>                {children(item, {                  handle: { 'type': 'button', 'className': 'kanban-handle', 'aria-pressed': 'false', 'aria-label': drag(item) },                  move: { 'type': 'button', 'className': 'kanban-move', 'popoverTarget': `${id}-mover`, 'aria-label': move(item) },                })}              </li>            ))}          </ol>          <p className="kanban-empty">{empty ? empty(column) : 'No items'}</p>        </section>      ))}      <div className="popover popover-end" popover="auto" id={`${id}-mover`}>        <form className="kanban-mover">          <label className="field">            {columnLabel}            <select className="select" name="column" />          </label>          <label className="field">            {position}            <select className="select" name="position" />          </label>          <div className="kanban-mover-actions">            <button type="button" className="btn btn-sm" popoverTarget={`${id}-mover`} popoverTargetAction="hide">{cancel}</button>            <button type="submit" className="btn btn-sm btn-primary">{confirm}</button>          </div>        </form>      </div>      <div className="kanban-preview" popover="manual" aria-hidden="true" />      <p className="kanban-status" role="status" />    </div>  )}/** * The items of each column, in the order an arrangement gives them. An item it does not name keeps the column * it names itself, or the first, after the ones it does; a value it names that no item has is passed over. */function arranged<C extends KanbanColumn, T extends KanbanItem>(columns: C[], items: T[], order: KanbanValue = []): T[][] {  const named = new Set(order.flatMap(entry => entry.items))  const own = (item: T) => columns.some(column => column.value === item.column) ? item.column : columns[0]?.value  return columns.map((column) => {    const listed = (order.find(entry => entry.value === column.value)?.items ?? []).flatMap(value => items.filter(item => item.value === value))    return [...listed, ...items.filter(item => !named.has(item.value) && own(item) === column.value)]  })}
ui/Kanban.svelte
<script lang="ts" module>  import type { Snippet } from 'svelte'  import type { HTMLAttributes, HTMLButtonAttributes } from 'svelte/elements'  import type { KanbanMessages, KanbanValue } from '@master/ui/behaviors/kanban.js'  export type { KanbanValue }  export interface KanbanColumn {    /** What the column stands for in the arrangement. */    value: string    /** The column's name: its title, and what the status and the mover call it. */    label: string  }  export interface KanbanItem {    /** What the item stands for in the arrangement. No other item has it. */    value: string    /** What the item is called: its handle and its move button are named with it. */    label: string    /** The column the item starts in, and stays in while the arrangement does not name it. The first by default. */    column?: string  }  export interface KanbanLabels<T extends KanbanItem> {    /** The accessible name of an item's handle. `Drag <label>` by default. */    drag?: (item: T) => string    /** The accessible name of the button that opens the mover for an item. `Move <label>` by default. */    move?: (item: T) => string    /** The mover's two fields and two buttons. */    column?: string    position?: string    confirm?: string    cancel?: string  }  /** What an item's own markup spreads on its two buttons. */  export interface KanbanControls {    /** For the grip, an empty `<button>`: it carries the item with the pointer and the keys. */    handle: HTMLButtonAttributes    /** For the button that opens the mover, an empty `<button>`: a column and a position are chosen there. */    move: HTMLButtonAttributes  }  export interface KanbanProps<C extends KanbanColumn, T extends KanbanItem> extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {    /** The columns, in their order. The order is not the reader's to change. */    columns: C[]    items: T[]    /** The arrangement: each column's value and the values of its items, in order. Bind it, or leave it out. */    value?: KanbanValue    onValueChange?: (value: KanbanValue) => void    /** What an item shows, with the attributes of its handle and of its move button to spread. Each button holds its icon. */    children: Snippet<[T, KanbanControls]>    /** What stands beside a column's title, such as the number of items it holds. */    header?: Snippet<[C, T[]]>    /** What a column says while it holds no item. */    empty?: Snippet<[C]>    /** The names of the controls, in the page's language. */    labels?: KanbanLabels<T>    /** What the status region says, in the page's language. */    messages?: KanbanMessages  }  /**   * The items of each column, in the order an arrangement gives them. An item it does not name keeps the   * column it names itself, or the first, after the ones it does; a value no item has is passed over.   */  function arranged<C extends KanbanColumn, T extends KanbanItem>(columns: C[], items: T[], order: KanbanValue = []): T[][] {    const named = new Set(order.flatMap(entry => entry.items))    const own = (item: T) => columns.some(column => column.value === item.column) ? item.column : columns[0]?.value    return columns.map((column) => {      const listed = (order.find(entry => entry.value === column.value)?.items ?? []).flatMap(value => items.filter(item => item.value === value))      return [...listed, ...items.filter(item => !named.has(item.value) && own(item) === column.value)]    })  }</script><script lang="ts" generics="C extends KanbanColumn, T extends KanbanItem">  import { tick, untrack } from 'svelte'  import { kanban } from '@master/ui/behaviors/kanban.js'  import { behavior } from './behavior.svelte.js'  const id = $props.id()  let { columns, items, value = $bindable(), onValueChange, children, header, empty, labels = {}, messages, class: className, ...root }: KanbanProps<C, T> = $props()  let kept = $state(untrack(() => value))  const shown = $derived(arranged(columns, items, value ?? kept))  const drag = $derived(labels.drag ?? ((item: T) => `Drag ${item.label}`))  const move = $derived(labels.move ?? ((item: T) => `Move ${item.label}`))  // A move waits for the render that writes the item in its place, so focus finds its handle there.  const arrange = async (next: KanbanValue) => {    kept = next    value = next    onValueChange?.(next)    await tick()  }  const attach = behavior(kanban, () => ({ messages, arrange }))</script><!--  @component  A board whose items the reader moves between columns. Svelte writes the columns and their items in the  arrangement it holds; the behavior carries an item with the pointer and the keys, and asks Svelte to arrange  the board when one is dropped. An item that changes column is rendered again in its new list, so what it  shows comes from the data, not from state kept inside it.--><div class={['kanban', className]} role="group" {@attach attach} {...root}>  {#each columns as column, at (column.value)}    <section class="kanban-column" data-value={column.value} aria-labelledby="{id}-column-{at}">      <header class="kanban-header">        <h3 class="kanban-title" id="{id}-column-{at}">{column.label}</h3>        {@render header?.(column, shown[at]!)}      </header>      <ol class="kanban-items">        {#each shown[at]! as item (item.value)}          <li class="kanban-item" data-value={item.value}>            {@render children(item, {              handle: { 'type': 'button', 'class': 'kanban-handle', 'aria-pressed': 'false', 'aria-label': drag(item) },              move: { 'type': 'button', 'class': 'kanban-move', 'popovertarget': `${id}-mover`, 'aria-label': move(item) },            })}          </li>        {/each}      </ol>      <p class="kanban-empty">{#if empty}{@render empty(column)}{:else}No items{/if}</p>    </section>  {/each}  <div class="popover popover-end" popover="auto" id="{id}-mover">    <form class="kanban-mover">      <label class="field">        {labels.column ?? 'Column'}        <select class="select" name="column"></select>      </label>      <label class="field">        {labels.position ?? 'Position'}        <select class="select" name="position"></select>      </label>      <div class="kanban-mover-actions">        <button type="button" class="btn btn-sm" popovertarget="{id}-mover" popovertargetaction="hide">{labels.cancel ?? 'Cancel'}</button>        <button type="submit" class="btn btn-sm btn-primary">{labels.confirm ?? 'Move'}</button>      </div>    </form>  </div>  <div class="kanban-preview" popover="manual" aria-hidden="true"></div>  <p class="kanban-status" role="status"></p></div>
ui/Kanban.vue
<script setup lang="ts" generic="C extends { value: string, label: string }, T extends { value: string, label: string, column?: string }">import { computed, nextTick, ref, useId, useTemplateRef } from 'vue'import { kanban, type KanbanMessages, type KanbanValue } from '@master/ui/behaviors/kanban.js'import { useBehavior } from './use-behavior'defineOptions({ inheritAttrs: false })const { columns, items, labels = {}, messages } = defineProps<{  /** The columns, in their order, each with the value it stands for and its name. The order is not the reader's to change. */  columns: C[]  /**   * Each with the value it stands for, which no other item has, the label its controls are named with, and   * the column it starts in: the first by default.   */  items: T[]  /**   * The names of the controls, in the page's language: `drag` and `move` name an item's handle and the   * button that opens the mover, `Drag <label>` and `Move <label>` by default; the others are the mover's   * two fields and two buttons.   */  labels?: { drag?: (item: T) => string, move?: (item: T) => string, column?: string, position?: string, confirm?: string, cancel?: string }  /** What the status region says, in the page's language. */  messages?: KanbanMessages}>()/** The arrangement, each column's value and the values of its items in order: `v-model`. */const model = defineModel<KanbanValue>()defineSlots<{  /**   * What an item shows. Bind `handle` on the grip, an empty button that carries the item with the pointer and   * the keys, and `move` on another, which opens the mover.   */  default?: (props: { item: T, handle: { 'type': 'button', 'class': string, 'aria-pressed': 'false', 'aria-label': string }, move: { 'type': 'button', 'class': string, 'popovertarget': string, 'aria-label': string } }) => unknown  /** What stands beside a column's title, such as the number of items it holds. */  header?: (props: { column: C, items: T[] }) => unknown  /** What a column says while it holds no item. */  empty?: (props: { column: C }) => unknown}>()/* * A board whose items the reader moves between columns. Vue writes the columns and their items in the * arrangement it holds; the behavior carries an item with the pointer and the keys, and asks Vue to arrange * the board when one is dropped. An item that changes column is rendered again in its new list, so what it * shows comes from the data, not from state kept inside it. */const id = useId()const kept = ref<KanbanValue | undefined>(model.value)const order = computed(() => model.value ?? kept.value ?? [])/** * The items of each column, in the order the arrangement gives them. An item it does not name keeps the * column it names itself, or the first, after the ones it does; a value no item has is passed over. */const shown = computed(() => {  const named = new Set(order.value.flatMap(entry => entry.items))  const own = (item: T) => columns.some(column => column.value === item.column) ? item.column : columns[0]?.value  return columns.map((column) => {    const listed = (order.value.find(entry => entry.value === column.value)?.items ?? []).flatMap(value => items.filter(item => item.value === value))    return [...listed, ...items.filter(item => !named.has(item.value) && own(item) === column.value)]  })})const drag = (item: T) => labels.drag?.(item) ?? `Drag ${item.label}`const move = (item: T) => labels.move?.(item) ?? `Move ${item.label}`// A move waits for the render that writes the item in its place, so focus finds its handle there.const arrange = async (next: KanbanValue) => {  kept.value = next  model.value = next  await nextTick()}const root = useTemplateRef<HTMLDivElement>('root')useBehavior(root, kanban, () => ({ messages, arrange }))</script><template>  <div class="kanban" role="group" ref="root" v-bind="$attrs">    <section v-for="(column, at) in columns" :key="column.value" class="kanban-column" :data-value="column.value" :aria-labelledby="`${id}-column-${at}`">      <header class="kanban-header">        <h3 class="kanban-title" :id="`${id}-column-${at}`">{{ column.label }}</h3>        <slot name="header" :column="column" :items="shown[at]!" />      </header>      <ol class="kanban-items">        <li v-for="item in shown[at]" :key="item.value" class="kanban-item" :data-value="item.value">          <slot            :item="item"            :handle="{ 'type': 'button', 'class': 'kanban-handle', 'aria-pressed': 'false', 'aria-label': drag(item) }"            :move="{ 'type': 'button', 'class': 'kanban-move', 'popovertarget': `${id}-mover`, 'aria-label': move(item) }"          />        </li>      </ol>      <p class="kanban-empty"><slot name="empty" :column="column">No items</slot></p>    </section>    <div class="popover popover-end" popover="auto" :id="`${id}-mover`">      <form class="kanban-mover">        <label class="field">          {{ labels.column ?? 'Column' }}          <select class="select" name="column" />        </label>        <label class="field">          {{ labels.position ?? 'Position' }}          <select class="select" name="position" />        </label>        <div class="kanban-mover-actions">          <button type="button" class="btn btn-sm" :popovertarget="`${id}-mover`" popovertargetaction="hide">{{ labels.cancel ?? 'Cancel' }}</button>          <button type="submit" class="btn btn-sm btn-primary">{{ labels.confirm ?? 'Move' }}</button>        </div>      </form>    </div>    <div class="kanban-preview" popover="manual" aria-hidden="true" />    <p class="kanban-status" role="status" />  </div></template>

#Classes

ClassDescription
kanbanThe 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-columnA column, a tray named by its title. It stands for its data-value. With hidden it takes no item and is passed over
kanban-headerThe head of a column: its title and whatever stands beside it, such as a count. It stays while the list scrolls
kanban-titleThe column's name, on the line the items' words start on
kanban-itemsThe list of a column, in the order of the document. It is the part that scrolls
kanban-items-targetSet 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-itemAn 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-targetSet by the behavior on the item the carried one would land before: a line in the gap over itApply with kanban-item
kanban-handleThe 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-controlsWhat 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-moveThe 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-emptyA few words in a shallow well, shown in place of the list while the column holds no item
kanban-previewAn empty element the behavior shows in the top layer during a drag, with the carried item's name, at the pointer
kanban-preview-landingSet by the behavior after the release, while the sheet glides to the place the item tookApply with kanban-preview
kanban-moverThe 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-actionsThe mover's buttons, at its end: the one that closes it, then the one that moves
kanban-statusA region that says each pick, place, drop and cancel, inside the board or right after it. It takes no room

#Custom properties

PropertyDefaultDescription
--kanban-column-width17.5remThe width of a column, which is never wider than the board less 2rem
--kanban-gap.75remThe room between two columns
--kanban-inset.375remThe room between a column's edge and its items; the column's corner is the items' corner plus it
--kanban-item-gap.375remThe room between two items, where the line of a place stands
--kanban-padding.75remThe padding of a card the board holds; a column's title starts on the same line
--kanban-radiusvar(--radius-control-lg)The corner of a card the board holds, of an empty column's well and of the carried sheet
--kanban-markervar(--color-focus)The ink of the line, and of the ring around an empty column, that marks a place
--kanban-linecalc(.9375rem * 1.4)The height of the line the pair of controls centers on: a card title's by defaultSet on kanban-controls
--kanban-xWhere the carried sheet's start edge is, from the viewport's left; the script writes itSet on kanban-preview
--kanban-yWhere the carried sheet's top is, from the viewport's top; the script writes itSet on kanban-preview
--kanban-widthThe width of the carried sheet, the carried item's own; the script writes itSet on kanban-preview

#Source

@master/ui/components/kanban.css
/* * Kanban: a board of columns, each a named section that holds a list of items, where an item is moved to * another place in its column or into another column: by dragging its handle, with the keys, or by choosing a * column and a position in the mover. * The board is a row that scrolls across; a column is a tray as wide as --kanban-column-width, never wider than * the board less a peek of the next, and its list scrolls by itself once the column is as tall as the board. * A column's corner is the corner of what it holds plus its inset, and its title starts on the line the * items' words start on. What an item holds is the page's: a card, a badge, an avatar. * Nothing moves while an item is carried. The item stays in its place and fades, a line stands in the gap it * would land in, kanban-item-target before an item or kanban-items-target at the end of a list, and a small * sheet with the item's name follows the pointer in the top layer, clear of every column's clipping, placed * by --kanban-x and --kanban-y at the width --kanban-width. Those three are the only things the behavior * measures and writes. On the release the sheet glides into the place the item took and leaves. * Without the popover API there is no sheet: the faded item and the line still say what is carried and where. */@layer components.ui {  .kanban {    --kanban-column-width: 17.5rem;    --kanban-gap: .75rem;    --kanban-inset: .375rem;    --kanban-item-gap: .375rem;    --kanban-padding: .75rem;    --kanban-radius: var(--radius-control-lg);    --kanban-marker: var(--color-focus);    position: relative;    display: flex;    align-items: flex-start;    gap: var(--kanban-gap);    min-width: 0;    min-height: 0;    overflow-x: auto;    overscroll-behavior-x: contain;    scrollbar-width: thin;    scrollbar-color: var(--color-line-strong) transparent;    /* While an item is carried the cursor is a closed hand wherever the pointer goes, and no text is selected. */    &:has(.kanban-handle[aria-pressed="true"]) {      cursor: grabbing;      user-select: none;      -webkit-user-select: none;    }    /* A card the board holds takes the board's corner and padding, so the column's corner and title follow it. */    .card {      --card-radius: var(--kanban-radius);      --card-padding: var(--kanban-padding);    }    @media (forced-colors: active) {      scrollbar-color: auto;    }  }  /* A column: a tray that holds its header and its list, as tall as what it holds and never taller than the board. */  .kanban-column {    --surface-color: var(--color-surface-tray);    display: flex;    flex: none;    flex-direction: column;    width: min(var(--kanban-column-width), 100% - 2rem);    min-width: 0;    max-height: 100%;    border-radius: calc(var(--kanban-radius) * var(--corner-scale) + var(--kanban-inset));    corner-shape: var(--corner-shape);    background: var(--color-surface-tray);    color: var(--color-text-body);    box-shadow: inset 0 0 0 .5px var(--color-line-hair), inset 0 1px 2px -1px var(--color-shade-2);    &[hidden] {      display: none;    }    @media (forced-colors: active) {      outline: 1px solid CanvasText;      outline-offset: -1px;    }  }  /* The head of a column stays while its list scrolls. Its words start where the items' words start. */  .kanban-header {    display: flex;    flex: none;    align-items: center;    gap: .5rem;    min-height: 2.5rem;    padding: .375rem calc(var(--kanban-inset) + var(--kanban-padding)) .125rem;  }  .kanban-title {    flex: 1;    min-width: 0;    margin: 0;    color: var(--color-text-strong);    font-size: .8125rem;    font-weight: var(--font-weight-control);    line-height: 1.4;    overflow-wrap: break-word;  }  /* The list. It is the one part of a column that scrolls, and it keeps room for the line of a place at its ends. */  .kanban-items {    display: flex;    flex: 1 1 auto;    flex-direction: column;    gap: var(--kanban-item-gap);    min-height: 0;    margin: 0;    padding: var(--kanban-item-gap) var(--kanban-inset) var(--kanban-inset);    overflow-y: auto;    /* Its end does not move the page under it; a swipe or a wheel across still reaches the board, which scrolls that way. */    overscroll-behavior-y: contain;    list-style: none;    scrollbar-width: thin;    scrollbar-color: var(--color-line-strong) transparent;    @media (forced-colors: active) {      scrollbar-color: auto;    }  }  .kanban-item {    position: relative;    flex: none;    min-width: 0;    margin: 0;    padding: 0;    scroll-margin: var(--kanban-inset);    transition-property: opacity;    transition-duration: var(--duration-quick);    transition-timing-function: var(--easing-glide);    /* Carried: it keeps its place and fades, so the reader sees where it came from. */    &:has(.kanban-handle[aria-pressed="true"]) {      opacity: .45;    }    /* Held by the keys, its handle has focus: it fades less, so the ring around the grip stays plain. */    &:has(.kanban-handle[aria-pressed="true"]:focus) {      opacity: .7;    }    /* The place before this item: a line in the middle of the gap over it. */    &.kanban-item-target::before {      content: '';      position: absolute;      inset-inline: 0;      top: calc(var(--kanban-item-gap) / -2 - 1px);      height: 2px;      border-radius: 1px;      background: var(--kanban-marker);      pointer-events: none;    }    @media (prefers-reduced-motion: reduce) {      transition-property: none;    }    @media (forced-colors: active) {      &.kanban-item-target::before {        background: Highlight;      }    }  }  /* An empty list with no well to show keeps its room, and the line of a place is drawn across the middle of it. */  .kanban-items-target:not(:has(.kanban-item)) {    background: linear-gradient(var(--kanban-marker), var(--kanban-marker)) center / calc(100% - var(--kanban-inset) * 2) 2px no-repeat;    @media (forced-colors: active) {      background-image: linear-gradient(Highlight, Highlight);    }  }  /*   * An item is carried by any part of it with a mouse, and says so with the hand where a pointer hovers; a   * link, a button or a field in it keeps its own cursor and its own press.   */  @media (hover: hover) and (pointer: fine) {    .kanban-item:has(.kanban-handle:enabled) {      cursor: grab;    }  }  /*   * A move is drawn by the platform where it can be: the behavior starts a view transition scoped to the board,   * each item is named by its own node, and every item glides from where it stood to where it stands. A list is   * named too and holds its items' pictures, clipped as the list clips them: an item past the foot of a long   * column, or scrolled under its head, stays out of sight on the way. An item that changes column is drawn by   * the list it arrives in, so it comes in from that list's edge while the carried sheet crosses the gap. The   * names stay inside the board, so a page's own transitions take the board as one picture.   */  @supports (view-transition-scope: all) {    .kanban {      view-transition-scope: all;    }    .kanban-items {      view-transition-name: match-element;      view-transition-class: kanban-items;      view-transition-group: contain;    }    .kanban-item {      view-transition-name: match-element;      view-transition-class: kanban-item;    }    /*     * The board takes no press while the pictures glide, so the glide is quick, the board's own picture with     * it: a reader who drops one card and reaches for the next finds it answering.     */    .kanban::view-transition-group(*),    .kanban::view-transition-old(*),    .kanban::view-transition-new(*) {      animation-duration: var(--duration-quick);      animation-timing-function: var(--easing-glide);    }    .kanban::view-transition-group-children(.kanban-items) {      overflow: clip;    }  }  /*   * The place at the end of a list: a line under its last item, in the middle of the gap the item would leave   * there. It is drawn by that item, out of flow as the line over an item is, so marking a place never changes   * how far the list scrolls: a line that was an item of the list made it 2px longer and moved every item.   */  .kanban-items-target .kanban-item:nth-last-child(1 of .kanban-item)::after {    content: '';    position: absolute;    inset-inline: 0;    bottom: calc(var(--kanban-item-gap) / -2 - 1px);    height: 2px;    border-radius: 1px;    background: var(--kanban-marker);    pointer-events: none;    @media (forced-colors: active) {      background: Highlight;    }  }  /*   * What an empty column shows: a shallow well with a few words, in place of its list. A column that is the   * place an item would land in has no gap to draw a line in, so the well takes the marker's ink as a ring.   */  .kanban-empty {    display: none;    place-items: center;    min-height: 3.5rem;    margin: var(--kanban-item-gap) var(--kanban-inset) var(--kanban-inset);    padding: .5rem var(--kanban-padding);    border-radius: calc(var(--kanban-radius) * var(--corner-scale));    corner-shape: var(--corner-shape);    background: var(--color-surface-inset);    color: var(--color-text-muted);    box-shadow: inset 0 0 0 .5px var(--color-line-hair);    font-size: .8125rem;    line-height: 1.4;    text-align: center;  }  .kanban-column:not(:has(.kanban-item)):has(.kanban-empty) {    .kanban-items {      display: none;    }    .kanban-empty {      display: grid;    }    &:has(.kanban-items-target) .kanban-empty {      color: var(--color-text-strong);      box-shadow: inset 0 0 0 1.5px var(--kanban-marker);      @media (forced-colors: active) {        outline: 2px solid Highlight;        outline-offset: -2px;      }    }  }  /*   * An item's two controls, a quiet pair of the same size: the handle, which carries the item, and the button   * that opens the mover. Each holds its icon, a grip and two arrows that pass, at 14px; each is 24px and shows   * only that icon until the pointer or the keys reach it, and its target is 44px tall on touch without moving it.   */  .kanban-handle,  .kanban-move {    --icon-size: .875rem;    position: relative;    display: inline-grid;    flex: none;    place-items: center;    width: 1.5rem;    height: 1.5rem;    margin: 0;    padding: 0;    border: 0;    border-radius: calc(var(--radius-chip) * var(--corner-scale));    corner-shape: var(--corner-shape);    background: transparent;    color: var(--color-text-muted);    appearance: none;    user-select: none;    -webkit-user-select: none;    -webkit-tap-highlight-color: transparent;    transition-property: background-color, color;    transition-duration: var(--duration-quick);    transition-timing-function: var(--easing-glide);    &::after {      content: '';      position: absolute;      inset: -.25rem;      @media (pointer: coarse) {        inset: min(-.25rem, calc((100% - 2.75rem) / 2));      }    }    @media (hover: hover) {      &:hover:not(:disabled) {        background: var(--color-surface-chip);        color: var(--color-text-strong);      }    }    &:focus-visible {      @apply --focus-ring;      outline-offset: 0;      color: var(--color-text-strong);    }    &:disabled {      color: var(--color-text-disabled);      cursor: not-allowed;    }  }  /*   * The pair at the end of an item's first line. The two stand close; the pair reaches into the item's padding   * by .5rem, as far as the grip's points stand in from its box, so the points meet the edge the words under   * them end on and only a hover chip shows past it; and it centers on a line of --kanban-line, a card title's   * by default, so it stands beside the first line and does not deepen it.   */  .kanban-controls {    --kanban-line: calc(.9375rem * 1.4);    display: inline-flex;    flex: none;    align-items: center;    gap: .125rem;    margin-block: calc((var(--kanban-line) - 1.5rem) / 2);    margin-inline-end: -.5rem;  }  /*   * The two stand .125rem apart, so on the side where they meet each target stops halfway: a target that reached   * its full depth there lay over the other button, and a press on the edge of one answered as the other.   */  .kanban-controls:has(.kanban-handle) .kanban-move::after {    inset-inline-end: -.0625rem;  }  .kanban-controls:has(.kanban-move) .kanban-handle::after {    inset-inline-start: -.0625rem;  }  @media (hover: hover) and (pointer: fine) {    .kanban-item:hover .kanban-move,    .kanban-item:focus-within .kanban-move {      opacity: 1;    }  }  .kanban-handle {    cursor: grab;    /* A drag that starts on the grip never scrolls; the rest of the item still does. */    touch-action: none;    /* Carried: the grip sits in a well, as a pressed button does. */    &[aria-pressed="true"] {      background: var(--color-surface-inset);      color: var(--color-text-strong);      box-shadow: var(--shadow-pressed);      cursor: grabbing;    }  }  .kanban-move {    cursor: pointer;    touch-action: manipulation;    /*     * Where a pointer hovers, the way to move without a drag waits out of sight until the pointer or the keys     * are on its item: a board of cards then shows one grip to a card, not a pair. A finger has no hover, so on     * a touch screen it is always drawn.     */    @media (hover: hover) and (pointer: fine) {      opacity: 0;      transition-property: background-color, color, opacity;      @media (prefers-reduced-motion: reduce) {        transition-property: background-color, color;      }    }  }  /*   * The carried item's name on a small raised sheet, in the top layer, where no column clips it. It is a manual   * popover the behavior shows; it stands at the viewport's corner and --kanban-x and --kanban-y carry it to the   * pointer, with no easing between the two. Landing, it glides to the place the item took, then leaves.   */  .kanban-preview {    display: none;    position: fixed;    inset: 0 auto auto 0;    box-sizing: border-box;    width: var(--kanban-width, 16rem);    max-width: calc(100vw - 1rem);    margin: 0;    /*     * The room under the words is a clear border, not padding: the clamp cuts at the padding's edge, and an     * engine that still paints the line after the last showed the top of it in padding there.     */    padding: .625rem var(--kanban-padding, .75rem) 0;    border: 0;    border-block-end: .625rem solid transparent;    border-radius: calc(var(--kanban-radius, var(--radius-control-lg)) * var(--corner-scale));    corner-shape: var(--corner-shape);    overflow: hidden;    @apply --surface-sheet;    color: var(--color-text-strong);    box-shadow: var(--shadow-floating);    font-size: .875rem;    font-weight: var(--font-weight-control);    line-height: 1.4;    translate: var(--kanban-x, 0px) var(--kanban-y, 0px);    pointer-events: none;    user-select: none;    -webkit-user-select: none;    will-change: translate;    @supports selector(:popover-open) {      opacity: 0;      transition-property: opacity, overlay, display;      transition-duration: var(--duration-quick);      transition-timing-function: var(--easing-glide);      transition-behavior: allow-discrete;      &:popover-open {        display: -webkit-box;        opacity: 1;        -webkit-box-orient: vertical;        -webkit-line-clamp: 2;        @starting-style {          opacity: 0;        }      }    }    &.kanban-preview-landing {      transition-property: translate, opacity, overlay, display;      transition-duration: var(--duration-base), var(--duration-quick), var(--duration-quick), var(--duration-quick);    }    @media (prefers-reduced-motion: reduce) {      &.kanban-preview-landing {        transition-property: opacity, overlay, display;      }    }    @media (forced-colors: active) {      outline: 2px solid Highlight;      outline-offset: -2px;    }  }  /* The mover: the form of a popover where a column and a position are chosen, for a hand that does not drag. */  .kanban-mover {    display: grid;    gap: .75rem;    width: 15rem;    max-width: 100%;    margin: 0;  }  /* The mover's buttons stand at its end, the one that moves last. */  .kanban-mover-actions {    display: flex;    flex-wrap: wrap;    justify-content: flex-end;    gap: .5rem;  }  /* What the status region says is for assistive technology: it takes no room. */  .kanban-status {    position: absolute;    width: 1px;    height: 1px;    margin: -1px;    padding: 0;    overflow: hidden;    clip-path: inset(50%);    white-space: nowrap;  }}