Task
How many tasks are attached to something, and how pressing they are.
Installation
npx shadcn@latest add https://qure-ui.qure.ai/r/task.jsonUsage
import { Task } from '@/components/ui/task'<Task count={6} states={['overdue', 'soon']} />A count on its own answers how much, which is rarely the question anyone has. The dots answer how soon without spending a second column on it — a worklist row can say six tasks, two of them past due, in the width of a chip.
This is one of the components with no shadcn equivalent. It comes from the Qure design system.
Two axes, one pill
count is the number. states is what is in there, and it is a set rather than an enum:
| State | Dot | Means |
|---|---|---|
overdue | urgent | Past its date |
soon | attention | Due within the week |
upcoming | neutral | More than a week out |
A pill with no states drops the dots and uses a plain document glyph. With dots, the glyph gains a notch at the top-right corner for them to sit in — that is two drawings in the Figma file, not one with an overlay, and it is why the dots never clip the document.
The Figma component ships its variants as urgent, variant2 … variant6, which name nothing.
They resolve against the states the qtrack app actually computes — done, overdue, soon,
upcoming. The tell is variant4, which carries a red dot and an amber one: that is not a
fifth enum value, it is two flags at once, which is why states is an array.
done has no pill. A resolved task is not outstanding, so it does not count.
Order is not the caller's problem
['overdue', 'soon']['soon', 'overdue']The dots are sorted by the component. Passing ['soon', 'overdue'] renders the same thing as
['overdue', 'soon'], so a column of pills lines up and the most pressing dot is always leftmost.
A component that renders in call order looks fine in isolation and ragged in a list.
In a worklist
- RKKaur R.PT-4019266 tasks, including overdue and due soon
- MPPrasad M.PT-4018822 tasks, including due soon
- JFFernandes J.PT-4017433 tasks, including upcoming
- SIIyer S.PT-4016000 tasks
Where the two axes pay for themselves. Scanning down, the count says how much work and the dots say how urgent, and neither needs a column header to be read.
As an affordance
render swaps the span for a button, so it is focusable and announces as one. The hover and focus
styles follow automatically — the stylesheet keys them off the element rather than off a prop:
<Task render={<button type="button" aria-label="Add a task" />}>+</Task>children replaces the count when you pass it, which is how the + gets in. Give it an
aria-label: a lone + is not a description of anything.
Accessibility
The glyph and its dots are one aria-hidden unit, and the pill carries a visually-hidden sentence
instead:
<span class="sr-only">6 tasks, including overdue and due soon</span>Announcing the dots individually would be three unlabelled circles. The sentence says what they mean, which is what the reader wants and what colour alone cannot carry — the whole point of having a count and dots is that the pill still works for someone who cannot tell the red from the amber.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
count | number | — | How many tasks. Ignored when children is given. |
states | TaskState[] | [] | "overdue", "soon", "upcoming". Order does not matter. |
children | ReactNode | — | Replaces the count. |
render | ReactElement | <span /> | Render as something else — a button, a link. |
TASK_STATE_LABEL exports the wording used in the announcement, so a tooltip or a filter can
reuse it rather than retyping it.