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.
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.
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
Anatomy
TaskCard: the card. PassonClickto make it open the task's details.TaskCardRowandTaskCardBody: 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 wasTaskCardDescription. Optional.
States
Behavior
- A card with an
onClickhovers 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.
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
TaskCarduses Base UI'suseRenderand renders anarticle. WithonClickit is clickable but not a button: give the keyboard a way to open the task, such as a link or button on the title.TaskCardStatusis a nativebuttonand 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.
busysetsaria-busy;disabledsetsaria-disabledon 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
Also takes the attributes of its element.
TaskCardBody, TaskCardChannel, TaskCardSubtitle, TaskCardLegacy, TaskCardMeta, TaskCardNumber, TaskCardRow
Also takes the attributes of its element.
TaskCardStatus
Also takes the attributes of its element.
TaskCardTitle
Also takes the attributes of its element.
Related
Changes
- 0.103.0 · Breaking ChangesData parts named for what they hold:
SearchEntityResultDescription→SearchEntityResultSubtitle,PreviewCardDescription→PreviewCardSubtitle,TaskCardDescription→TaskCardSubtitle,MobileNavServerPopoverRowDescription→MobileNavServerPopoverRowSubtitle(and their…Propstypes), andStep'sdescriptionprop →subtitle. Their look anddata-slotvalues are unchanged. - 0.58.0 · AddedTasks: a sixth status,
backlog, inTaskStatusIdandTASK_STATUS_IDS(nowbacklog, todo, in-progress, in-review, done, closed). It has no hue: a hollow pixel edged inline-strong(TaskStatusIcon, newTaskBacklogIcon), an untinted chip with a hairline outline (TaskChip,TaskStatusBadge,TaskCardStatus) and a hollowTimelineItemmarker.