组件 · 任务
TaskList
The list view of tasks — one collapsible group per status, in status order, each holding task cards.
import { TaskList } from "@botiverse/raft-ui";A TaskList groups tasks by status, one collapsible group per status, in the same order as the columns of a TaskBoard. It is the default view on a phone. When to show which view, and which groups start collapsed, is in Tasks.
When to use
| Situation | Use |
|---|---|
| Tasks on a phone or in a narrow panel | TaskList |
| Tasks by status, with room for five columns | TaskBoard |
| One task | TaskCard |
Anatomy
TaskListRoot: the stack of groups. Required.TaskSection: one status. A collapsible section. Required, one per status.TaskSectionTrigger: the group heading, which collapses the group.TaskSectionChevron: the arrow before the heading.TaskSectionHeading:TaskSectionBadge(the status pixel and name) andTaskSectionCount.
TaskSectionPanelandTaskSectionItems: the cards.TaskSectionEmpty: what an empty group says.
States
| State | Look |
|---|---|
| Collapsed | Only the heading and its count show |
| Empty group | A dashed line-seam box with one line of text in foreground-hint |
Behavior
- Scroll every group in one viewport. Groups don't scroll on their own.
- Mount only the visible cards of a tall group: make VirtualList the viewport, with the group headers and cards as its rows, or use a virtualizer of your own.
Content
- Write an empty group as "No", the status and "tasks", with the status spelled as on its chip (Writing): "No In Review tasks."
Accessibility
- Each group is a Base UI
Collapsiblerendered as asection; its trigger is a button witharia-expanded, named by the status and count it contains. - Show the count in the heading also when the group is collapsed, so the trigger still says how many tasks it hides.
API
TaskListRoot
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows 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.
TaskSection
| Prop | 类型 | 默认值 |
|---|---|---|
| Whether the collapsible panel is initially open. | boolean | false |
| Whether the component should ignore user interaction. | boolean | false |
| Event handler called when the panel is opened or closed. | (open: boolean, eventDetails: CollapsibleRootChangeEventDetails) => void | |
| Whether the collapsible panel is currently open. | boolean | |
| Allows 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.
TaskSectionBadge
| Prop | 类型 | 默认值 |
|---|---|---|
| TaskStatusId | ||
| Allows 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.
TaskSectionChevron, TaskSectionCount, TaskSectionEmpty, TaskSectionHeading, TaskSectionItems
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows 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.
TaskSectionPanel
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows the browser's built-in page search to find and expand the panel contents. | boolean | false |
| Whether to keep the element in the DOM while the panel is hidden. This prop is ignored when `hiddenUntilFound` is used. | boolean | false |
| Allows 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.
TaskSectionTrigger
| Prop | 类型 | 默认值 |
|---|---|---|
| Whether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`). | boolean | true |
| Allows 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.