Raft Design System

Components · Tasks

Tasks

The parts every task view shares — the status badge and task chip that show where a task is, the status pixels, and the shell of a task panel.

StableAlso called TaskChip, TaskStatusBadge, TaskStatusIcon, TasksPanel, task marker, task status
import { Tasks } from "@botiverse/raft-ui";

These are the parts every task view shares. TaskStatusBadge writes a task's status as a status chip: the status's soft tint, its pixel and its name. TaskChip is the same chip carrying a task instead, such as a task mentioned in running text (#design:#25). TasksPanelRoot and its parts are the shell of a page of tasks. The five statuses and how tasks are shown are in Tasks; their colors are in Color.

tasks/compositions/task-status

When to use

SituationUse
A task's status: on a card, in properties, in detailsTaskStatusBadge
The tasks created from a messageA list of compact rows under it, each with a TaskStatusBadge (Tasks)
A task mentioned in running textTaskChip with variant="inline"
A task's status as a pixel beside a wordTaskStatusIcon
A page or a tab of tasksTasksPanelRoot with its toolbar and viewport
A task as a row on a board or in a listTaskCard
How an agent isAn agent state chip (Status)

Anatomy

  • TaskStatusBadge: a TaskChip with the status pixel and the status name, which the caller supplies.
  • TaskChip: the chip. status sets its tint. Its children are a status icon, then the task number, then the assignee.
  • TaskStatusIcon, and TaskBacklogIcon, TaskTodoIcon, TaskInProgressIcon, TaskInReviewIcon, TaskDoneIcon, TaskClosedIcon: the status pixel. Backlog's is hollow (Color).
  • TasksPanelRoot: the column of a task page.
    • TasksPanelToolbar: the bar on top, with a seam under it. It holds TasksPanelToolbarNewTask, TasksPanelToolbarFilters and TasksPanelToolbarView (Board / List), and lays them out by the panel's own width: below 28rem (448px) New task and the view switch share the first line and the filters take the second; from 28rem they share one row that wraps. A task column 360px wide on a wide window takes the narrow layout (Switch on the region's width). TasksPanelToolbarGroup and TasksPanelToolbarLabel are for anything else in it. It is the toolbar over a list (Component tokens, list-toolbar): 8px above and below its controls and between its lines, at least 49px with its seam on a phone and a touch screen; on a desktop, once it is one row, the 44px header. The Board / List track is 6px taller than a control, so with it the row is 55px on a phone.
    • TasksPanelViewport: the scrolling content: a TaskBoard or a TaskList.
    • TasksPanelEmpty: holds an EmptyState when there are no tasks.
  • TaskLoadingList, TaskLoadingRow: placeholder rows while tasks load.
  • taskStatusSoft, taskStatusStrong and TASK_STATUS_IDS: the recipes for building another status surface from the same task-status-* tokens.
tasks/compositions/tasks-panel

Not yet implemented in raft-ui: this example shows the tasks before 0042, with five statuses and no completion control.

Variants

VariantUse for
variant="default"A chip on its own: on a task row, on a card, in a details row
variant="inline"A chip in running text, in the box every chip in a message's text shares (Chips in running text)
size="sm"A default chip in one row with small badges, such as the metadata row of an Activity item
task-chip/compositions/task-chip-variants
task-chip/compositions/task-chip-in-footer
task-chip/compositions/task-chip-in-markdown
task-chip/compositions/task-chip-sizes

States

  • Loading: loading dims a TaskChip and ignores the pointer while the task is resolved.
  • The panel is loading: TaskLoadingList, the same size as the cards it stands for (Feedback).
  • No tasks: TasksPanelEmpty, with one empty state when there are no tasks and another when the filters match none.
  • Failed to load: an error at the panel's scope, with Retry.
task-chip/compositions/task-chip-statuses
tasks/compositions/tasks-empty-states
tasks/compositions/tasks-error

Behavior

  • Make a status chip on a task card a button that opens the list of statuses, with a down arrow after the name (TaskCard). The other ways to change a status are in Tasks.
  • Make a task reference in running text open the task. A task row under a message opens it too; only its completion control changes the status (Tasks in a conversation).

Content

  • Spell the statuses Backlog, Todo, In progress, Done and Closed. TaskStatusBadge has no built-in label: the caller passes it, and translates it.
  • Set the task number in Space Mono: #25 (Typography).
  • In a task reference, write the place, then the number: #design:#25 (Referring to a task).

Accessibility

None of these parts wraps a Base UI primitive; TaskChip renders a <span> unless render makes it a link or a button.

  • The status pixel is hidden from assistive technology. Always pass the status name, or keep the task number next to it.
  • Render a task chip that opens the task as an <a> or a <button>, and give it an aria-label that says what it opens ("Open task #25") when its text doesn't. A title is not an accessible name.

Rules

  • Build any new surface that shows a task status from taskStatusSoft and taskStatusStrong, so a status has one color everywhere.
  • Don't give a chip a border: the tint is a highlight, not a sticker (Status). Backlog's chip, which has no tint, is the exception (Color).
  • A chip splits its padding evenly between its two ends: 7px each, 5px when sm, 4.5px inline, the same total as before. The status pixel is drawn to its edges, so the space before it is all padding; with 2px less on that end, the pixel sat 6px from the edge and the last letter 8.5px (Alignment). An inline chip keeps the status pixel in its own 10px box, 4px from the text (Chips in running text).

API

TasksPanelEmpty, TasksPanelRoot, TasksPanelToolbar, TasksPanelToolbarFilters, TasksPanelToolbarGroup, TasksPanelToolbarLabel, TasksPanelToolbarNewTask, TasksPanelToolbarView

PropTypeDefault
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

TasksPanelViewport

The tasks' scroller, a ScrollArea in both directions (a board is wider than the panel): `ref`, `className`, `render` and the native props are the scrolling element's.
PropTypeDefault
actionsRefMethods to scroll from code that the container doesn't have natively.((instance: ScrollAreaActions | null) => void | (() => void | { [UNDEFINED_VOID_ONLY]: never; }) | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | RefObject<ScrollAreaActions | null>
childrenThe scrolling content, in ScrollArea's own container.ReactNode
contentClassNameClass of a content element around `children`, inside the container: put padding and the content's own layout (grid, flex, `gap`, `stack-y-*`) here, so the scrollbars stay at the edges and the gutters layer is never one of the laid-out children. Only with it, `contentStyle` or `fade` is there one.string
contentRefAn element whose size is the content's, watched for size changes (such as a hidden mirror of a textarea's text). Without it each element child of the container is watched, and children added or removed.RefObject<HTMLElement | null>
contentStyleStyle of the content element; renders it, as `contentClassName` does.CSSProperties
fadeFade the content out toward an edge that has more past it. The scrollbars don't fade.boolean
hideDelayHow long the scrollbars stay after scrolling stops, in ms. At least 100 with `trigger="scroll"`.number
onEdgeChangeCalled when the area reaches or leaves an edge, and after mounting when the content overflows.(edges: ScrollAreaEdges) => void
onScrollThe container's scroll events.UIEventHandler<HTMLDivElement>
orientationThe directions the area scrolls in. Content too wide for a vertical area is cut off.ScrollAreaOrientation
overscrollWhat a scroll that reaches the end does: stop there with no bounce (`none`, the default), stop there but let Mac trackpads and iOS bounce the area (`contain`), or carry on to the page behind (`auto`, which leaves the container's own `overscroll-behavior` alone). Only in the directions the area overflows right now.ScrollAreaOverscroll
railInsetRoom in px the scrollbars keep clear at each end, such as a sticky header's height, so they don't run over it. Also settable in CSS, on the root: `--r-scroll-area-rail-inset-{top,bottom,left,right}`, which don't inherit.ScrollAreaRailInset
renderAnother element in place of ScrollArea's own `<div>`, as the container (an element or a function that gets the props). It must hold children: the gutters are its first child.ReactElement | ((props, state) => ReactElement)
sizeThumb thickness: `small` is 5px, `medium` 7px; both grow while pointed at or dragged.ScrollAreaSize"default"
tabIndexThe container's: by default `0` while there is something to scroll.number
triggerWhen the scrollbars show. They always show while scrolling or dragging.ScrollAreaTrigger

Also takes the attributes of its element.

TaskLoadingList, TaskLoadingRow

PropTypeDefault
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

TaskChip

PropTypeDefault
loadingbooleanfalse
size`sm` lines the chip up with an `sm` Badge in the same row.TaskChipSize"default"
status (required)TaskStatusId
variantTaskChipVariant"default"
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

TaskBacklogIcon, TaskClosedIcon, TaskDoneIcon, TaskInProgressIcon, TaskInReviewIcon

Takes the attributes of its element.

TaskStatusIcon

PropTypeDefault
status (required)TaskStatusId

Also takes the attributes of its element.

TaskTodoIcon

Takes the attributes of its element.

TaskStatusBadge

PropTypeDefault
childrenBadge text. The caller owns the copy (and its localization); Raft never hardcodes a status label here.ReactNode
sizeSame as `TaskChip`'s `size`: `sm` lines up with an `sm` Badge.TaskChipSize"default"
status (required)TaskStatusId
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

Changes

  • 0.73.0 · ChangedEvery region that scrolls is a ScrollArea: PanelScrollViewport, ActivityInboxViewport, SearchShellViewport, NotificationCenterScroller, FilesViewport, TasksPanelViewport, ChoiceList's scroller, MobileNavServerPopoverList, ComposerSuggestionList, AnnouncementDialogBody, MessageActionCardScopeListViewport and DialogNav show ScrollArea's overlay scrollbar instead of the platform's. Native scrolling stays only in the places scroll-area.md lists, each with its reason, and a test fails on any other.
  • 0.58.0 · AddedTasks: a sixth status, backlog, in TaskStatusId and TASK_STATUS_IDS (now backlog, todo, in-progress, in-review, done, closed). It has no hue: a hollow pixel edged in line-strong (TaskStatusIcon, new TaskBacklogIcon), an untinted chip with a hairline outline (TaskChip, TaskStatusBadge, TaskCardStatus) and a hollow TimelineItem marker.
  • 0.5.58 · FixedTaskChip / TaskStatusBadge size="sm" take the sm Badge's own box (padding, border, line height), so it no longer drifts from the Badge beside it.
  • 0.5.55 · FixedTaskChip / TaskStatusBadge size="sm" now also match the sm Badge's font weight and letter spacing (Elegant 500 / 0.22px, Brutal 700), so the chip no longer reads as a different font beside the Badges in slock's Activity card row. The default size and the inline variant are unchanged.
  • 0.5.54 · AddedTaskChip and TaskStatusBadge take size="sm", which gives the chip the sm Badge's text size and height (Elegant 11px / 18px, Brutal 10px / 20px; icon 10px) for a chip that shares a row with Badges, such as slock's Activity card metadata row. The default size and the inline variant are unchanged.
  • 0.5.41 · ChangedTaskStatusBadge now renders through TaskChip and has no look of its own: a status badge in a task panel and the task chip under a message share one shape, size, border and colour and differ only in content (status icon + the caller's label). Visible change: in Elegant the badge goes from 12px to the chip's 13px with a hairline border and a 19px height; in Brutal from bold 12px at 20px tall to the chip's medium 13px at about 18px tall, so rows that carry it are about 2px shorter. data-slot="task-status-badge" and data-status are kept; no API change.
  • 0.5.39 · FixedBrutal TaskStatusBadge draws a 1px black keyline instead of 2px, matching TaskChip and Badge; py-px keeps it exactly 20px tall, so surrounding layout does not move (Elegant unchanged).
  • 0.5.38 · FixedTaskChip's inline variant no longer paints its own neutral fill and transparent border over the status styling: task references inside message bodies take the same per-status fill, border, text and icon colours as the task chip under a message (Elegant; Brutal unchanged; font size and baseline rules untouched).