Skip to content

DocsDataTasks

PT

Data

Tasks

Step list with a counter, a spinning in-progress item and struck-through completed ones.

data-u="tasks"

Example

2 steps left
  • Read the project config
  • Generate the light theme tokens
  • Generate the dark theme tokens
  • Publish the component package
  • Run tests and build

Installation

Tasks ships in the full package, in unslop.css and unslop.js:

curl -fsSL unslop.leallabs.dev/i | sh

A ready-made block that uses tasks:

curl -fsSL unslop.leallabs.dev/i | sh -s add wall-tasks

No build Name-based add is for charts and blocks. Components with JS live in unslop.js, which mounts every data-u on the page by itself.

Props

They go in data-u-props, as JSON.

PropTypeDefaultWhat it does
autobooleanfalseAdvances on its own: the in-progress step completes and the next one starts. Turns off with reduced motion and off screen.
everynumber2600Advance interval, in ms.

Classes and variants

ClassWhat it does
u-tasksThe host.
u-tasks__list > li.u-taskEach step, with data-state todo, doing or done.
u-task__markThe marker. The JS draws the three states.
[data-count]Receives "N steps left" or "All done".

Accessibility and keyboard

State and roles

WhereAttributeWhat it says
[data-count]aria-live="polite"Announces how many are left.
hostdata-completeShows when everything is done.

Clicking an item toggles it between done and pending. Items are li and don't take keyboard focus.

Type to search. Arrows pick, Enter opens.