Task Row
ProOne line of a Gantt task list: a status bar, the name, an assignee and the dates. As a group it is a header that folds the rows under it open and closed.
Playground
Installation
Task Row comes with WunderUI Core and Pro, in the package from your plan. See the plans.
Then import what you need:
import { TaskRow, TaskRowProps } from "@wunderui/react"Then use it:
import { TaskRow } from "@wunderui/react"
export function Plan() {
return (
<div className="overflow-hidden rounded-xl border border-border bg-card">
<TaskRow name="Wireframes" barClassName="bg-primary" assignee={{ name: "Priya Raman", color: "purple" }} dates="Nov 9 – Nov 13" className="border-b-0" />
</div>
)
}Expected result: One row with a short indigo bar, the name Wireframes, a purple PR avatar and the dates at the right.
When to use
Use Task Row for
- The task column of a Gantt or timeline view, with groups that fold
- A task list where each row has an owner, a status colour and a date
- A project plan that is read more often than it is edited
Use something else for
- Checklist Task for a step in an onboarding checklist with a title, a description and a state
- Kanban for a task on a board, with labels, a due date and assignees
- Table for tasks that are sorted, filtered or compared across several columns
Type
A task is a 36 px row with a bar, name, assignee, dates and a rule. A group row is a button with only a name and chevron, no rule, assignee or dates, and fills with the page tone on hover.
Status
A background class sets the 20 px bar in front of the name, primary by default. Use one class per status, such as success for done and destructive for at risk; the row has no status text.
Assignee
The assignee is a person: a photo, or initials on a tint (purple by default). The avatar is 24 px in a 64 px column that stays when there is nobody, so the dates keep their place.
Dates
Dates sit in a 96 px column at the right in 11 px text, and a span gives them a colour, such as the red of an overdue date. The column does not wrap or cut, so keep the text short.
Width
The assignee (64 px) and dates (96 px) columns keep their width, so the name takes the rest and is cut with an ellipsis. Below about 320 px, hide the columns with a class.
Keyboard interactions
A group row is a native button with one tab stop. A task row is a plain div with none, and controls beside it, such as a checkbox, take focus in their own order.
- TaborShift+Tab
- Moves focus to the next or previous group row, and to any control you placed in a task row. A focused group row gets the indigo focus outline on its edge.
- EnterorSpace
- Presses the focused group row and calls ; the page then flips .
Arrow keys don't move between rows. Build the list as a ul so a screen reader announces its length, and keep the DOM order the same as the screen order.
Behavior and motion
What the row does with state, content, the DOM and motion.
- Task and group
- A task shows the bar, name, assignee and dates. A group is a button with a chevron and the name that reports expanded or collapsed, and it hides no rows itself, so render them only while open.
- States
- A task row is static, with no hover, pressed or focus look. A group row lightens on hover, goes subtle while pressed and shows the indigo focus outline on the keyboard, and the chevron flips at once.
- Columns and width
- The name takes the free width and is cut with an ellipsis. The assignee (64 px) and dates (96 px) columns keep their width, so below about 320 px hide them in a narrow list.
- Dates and status
- Dates and name take any content, so a due date can be coloured or a finished task struck through. The row has no check, done or overdue state of its own.
- Avatar
- An assignee with a photo shows it and keeps the initials as fallback. Without a photo the initials sit on a tint, purple by default, and the person's name is the avatar's title.
- Names for assistive technology
- A group button is announced as expanded or collapsed and points at the region it controls. A task reads as plain text, name then dates, and the bar isn't announced, so put status in text.
- Motion and reduced motion
- A group's fill fades quickly on hover, and instantly with reduced motion. Nothing moves, and folding a group shows or hides the rows at once.
Anatomy
The parts of a task row, numbered in the figure. Task Row is one component, so the bar, avatar and dates aren't separate exports, and a group row has only the chevron and name.
- 1data-slot="task-row"
The row, as high as a control (36 px, 40 px at comfortable density), with 16 px side padding and 16 px between columns. A task is a div with a 1 px rule under it, a group is a button.
- 2Optional
A 20 px wide, 4 px high rounded bar in front of the name. It is primary by default, can take a status colour, and is not announced.
- 3
The name in 14 px text on one line. It takes the free width and is cut with an ellipsis, and a group name is semibold.
- 4Optional
A centred 24 px avatar of the assignee in a 64 px column. The column stays when there is nobody.
- 5Optional
The dates in 11 px tertiary text, right-aligned in a 96 px column.
Best practices
- Do
Use group rows for collapsible sections. Pass the id of the region that holds the rows so the button also sets aria-controls.
- Do
Give each status one bar colour, such as green for done and red for at risk, and keep the mapping the same across the page.
- Do
Say the status in text too. The bar is just a picture, so put Done or Overdue in the dates or name where a screen reader reads it.
- Do
Add what the row lacks yourself: a checkbox in front of it in a list item, a struck-through name, coloured dates.
- Do
Hide the assignee and dates columns with a class in a narrow list. The row never drops them by itself.
- Don’t
Don't pass an assignee or dates to a group row. It shows only the name.
- Don’t
Don't treat the row as a button for the whole task. A task row is static with no hover or focus look, so put the action in a control inside your own wrapper.
- Don’t
Don't put a long sentence in the dates. The column is 96 px wide and doesn't wrap.
API reference
Task Row is one component with the props below. It takes no other attributes, so an id, a data attribute or an aria-label can't be passed to the row.
The row, as high as a control (36 px, 40 px at comfortable density), with 16 px side padding and 16 px between columns. A task is a div with a 1 px rule under it, a group is a button.
| Prop | Type | Default | Description |
|---|---|---|---|
| name required | ReactNode | — | The name of the task or the group, on one line. It takes any node, for example a span that strikes a finished task through. Required. |
| group | boolean | — | Makes the row a group header: a button with a chevron and the name. The bar, the assignee and the dates are not drawn. |
| open | boolean | true | For a group: whether its rows are shown. It sets and the direction of the chevron. Default . |
| onToggle | () => void | — | For a group: called when the button is pressed with the pointer, Enter or Space. Flip in it and show or hide the rows. |
| controls | string | — | For a group: the id of the region that holds its rows. It sets on the button, so a screen reader can jump to the rows the button shows or hides. |
| barClassName | string | "bg-primary" | A background class for the bar in front of the name, for example . Default . |
| assignee | Person | — | : a 24 px avatar in a 64 px column. Without it shows the initials on the tint of (default ). The column stays when there is no assignee. |
| dates | ReactNode | — | The dates, for example , in a 96 px column at the right. Text or a node; it does not wrap. |
| className | string | — | Added to the row, after the built-in classes. Use it for on the last row of a box, a height, or classes that hide the assignee and dates columns. |
Notes for AI
Give your coding assistant the Markdown reference instead of screenshots.
get_component("task-row")The full library index for assistants is at /llms.txt.
Related components
- To do2FeatureDesign
Address autocomplete for the shipping form
Nov 1832/3MKDO
DesignRedesign the product grid
Nov 215PRIn progress2 / 3FeatureApple Pay and Google Pay buttons
x40%Nov 144/10TFPRBugFix the double submit on slow networks
Nov 1210/2DOIn review1ContentCopy review for the error messages
Nov 152MKPress Space or Enter to pick up the card. Then use the arrow keys to move it within its column or to the next column, Space or Enter to drop it, and Escape to cancel.
Core Elements5 stylesProKanbanA drag-and-drop board of columns and cards. Recent invoicesInvoices issued in the last 30 days Invoice Status Customer Amount INV-2041 Paid WunderUI $24,800.00 INV-2040 Open Halcyon Labs $3,200.00 INV-2039 Overdue Pergola Foods $980.00 INV-2038 Paid Marlow & Finch $12,400.00 Total Sum$41,380.00 Core Elements5 stylesTableRows and columns with 23 ready-made cell types; for sorting and search use Data Table.