Raft Design System

Components · Tasks

TaskCard

The card that shows one task — its number, title and a status chip that changes the status, and in a place's view its completion control — on a task board and in a task list.

Stable
import { TaskCard } from "@botiverse/raft-ui";

A TaskCard shows one task: its number, its title and a status chip people can change, and, in a place's own view, a round completion control. A board and a TaskList use the same card. On a page of tasks the board's cards have no completion control: there a status is changed with the chip, a drag or the selected tasks' toolbar (Tasks). How tasks are shown, filtered and opened is in Tasks.

task-card/compositions/task-card-state-matrix

Not yet implemented in raft-ui: the examples on this page show the card before 0042, with no completion control and a menu of five statuses.

When to use

SituationUse
A task on a board or in a listTaskCard, inside a TaskBoard column or a TaskList group
A task in a conversationNot a card: a row in the list of tasks under the message it came from (Tasks)
A task's status or number in running text, a row or a headingTaskChip or TaskStatusBadge (Tasks components)
The task's detailsA centered dialog, or on a page of tasks a column beside the list; see Tasks

Anatomy

  • TaskCard: the card. Pass onClick to make it open the task's details.
  • TaskCardRow and TaskCardBody: the layout around the text.
  • TaskCardMeta: the first line. In a place's own view it starts with the completion control: put a TaskCompletionControl first in it (Completing a task). On a page of tasks, leave it out.
    • TaskCardChannel: the place the task belongs to (#launch-week). Optional; see Content.
    • TaskCardStatus: the status chip. Required.
    • TaskCardNumber: the task number (#25). Required.
    • TaskCardLegacy: a marker for a task from the old task system. Optional.
  • TaskCardTitle: the task's title, at most 3 lines. Required.
  • TaskCardSubtitle: data under the title, such as the task's own description, at most 2 lines. It was TaskCardDescription. Optional.

States

StateUse for
busy on TaskCard or TaskCardStatusA status change is being saved; the chip can't be pressed until it finishes
disabledA task that can't be opened or changed: a fill-muted card with foreground-disabled text
DraggingOn a board, the lifted copy of the card is the only card with shadow-float; the card stays in its column at 40% (TaskDnd)
task-card/compositions/task-card-state-matrix

Behavior

  • A card with an onClick hovers with the subtle tier, like the other cards people read, and presses with the medium tier; its status chip hovers medium (Hover and press).
  • Pressing the status chip opens a list of all five statuses, from any status, with a check on the current one (Select). Choosing one changes the status at once.
  • Pressing the completion control, where the card has one, completes or reopens the task (Completing a task).
  • Pressing the chip or the completion control doesn't open the card: stop the click from reaching TaskCard.
task-card/compositions/task-status-select

Content

  • Write the title in sentence case, as a verb and its object: "Polish the onboarding flow".
  • Show the channel only where tasks from several places are listed together, such as a product's task page. In a place's own Tasks view every task belongs to that place, so leave it out.
  • Set the channel and the number in Space Mono; the parts do this.
  • Spell the statuses Backlog, Todo, In progress, Done and Closed (Writing).

Accessibility

  • TaskCard uses Base UI's useRender and renders an article. With onClick it is clickable but not a button: give the keyboard a way to open the task, such as a link or button on the title.
  • TaskCardStatus is a native button and the trigger of the status Select. Give it an accessible name that includes the task: aria-label="Change status for task #25".
  • The completion control's semantics are in Completing a task, and the keys of a list of cards in Keyboard in a list of tasks.
  • busy sets aria-busy; disabled sets aria-disabled on the card.

Rules

  • Make the status chip, and the completion control where the card has one, the only things that can be changed on the card. Assignee and creator are changed in the task's details.
  • Don't add a shadow, a colored band or an accent border to the card: it is a white card with a hairline (Shape).

API

TaskCard

PropTypeDefault
busybooleanfalse
disabledbooleanfalse
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.

TaskCardBody, TaskCardChannel, TaskCardSubtitle, TaskCardLegacy, TaskCardMeta, TaskCardNumber, TaskCardRow

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.

TaskCardStatus

PropTypeDefault
busybooleanfalse
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.

TaskCardTitle

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.

Changes

  • 0.103.0 · Breaking ChangesData parts named for what they hold: SearchEntityResultDescription → SearchEntityResultSubtitle, PreviewCardDescription → PreviewCardSubtitle, TaskCardDescription → TaskCardSubtitle, MobileNavServerPopoverRowDescription → MobileNavServerPopoverRowSubtitle (and their …Props types), and Step's description prop → subtitle. Their look and data-slot values are unchanged.
  • 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.