组件 · 收件箱
ActivityInbox
The Activity panel — a list of inbox items with its views, filters and selection toolbar, where selecting an item opens it beside the list.
也叫 Activity
import { ActivityInbox } from "@botiverse/raft-ui";ActivityInbox lays out Activity: the panel that lists what happened elsewhere and waits for the person, as InboxItem rows. Selecting an item opens it beside the list. The panel has views (Active, Saved, Done), filters and a toolbar for acting on several items at once.
When to use
| Situation | Use |
|---|---|
| Mentions, approvals, hand-offs and replies the person should see | ActivityInbox |
| The state of the whole server | NotificationCenter |
| The result of an action the person took | Toast |
Where a product puts the way into Activity is on the product's own page.
Anatomy
ActivityInboxPanel: the panel. It holds a Panel header with the title Activity. Required.ActivityInboxSidebar: the column of views and filters on the left, as sidebar rows (Sidebar). Hidden on a phone.ActivityInboxControls: the row above the list: the filters (All, Unread and Mentions) and Mark all read. It has no search field: searching is the job of Search, and a field here would be a second way in.ActivityInboxSelectionToolbar: a select-all checkbox, then either the sort menu orActivityInboxSelectionCountand the actions for the selected items.ActivityInboxViewport: the scrolling list of InboxItem rows.ActivityInboxLoadingMore: one line at the end of the list while more items load.
States
| State | Use for |
|---|---|
| Loading | Skeleton rows in the shape of inbox items (Feedback) |
| Loading more | ActivityInboxLoadingMore under the last item |
| Empty | An EmptyState that says what will appear here |
Behavior
- Open a selected item beside the list, and mark it
activeon its row. - On a phone, replace the sidebar with one button in the panel header that opens the views and filters.
- When items are selected, replace the sort menu with the count and the actions for them.
- Put Mark All Read in the panel header as a small ghost button, when the panel offers it.
Accessibility
- The parts are plain layout elements; raft-ui adds no Base UI primitive. The views and filters are sidebar rows, the read filter is Tabs, and the sort is a DropdownMenu.
- Give the panel title a heading level (
render={<h2 />}). - Mark the current view with
aria-current="page"and a pressed filter witharia-pressed. - Name the select-all checkbox (
aria-label="Select all visible activity"). - Set
aria-busyonActivityInboxPanelwhile it loads.
API
ActivityInboxPanel
| Prop | 类型 | 默认值 |
|---|---|---|
| PanelEdge | ||
| 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.
ActivityInboxViewport, ActivityInboxLoadingMore
接受其元素的全部属性。
ActivityInboxSidebar
| 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.
ActivityInboxControls, ActivityInboxSelectionToolbar, ActivityInboxSelectionCount
接受其元素的全部属性。