Raft 设计系统

组件 · 收件箱

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.

activity/compositions/activity-inbox

When to use

SituationUse
Mentions, approvals, hand-offs and replies the person should seeActivityInbox
The state of the whole serverNotificationCenter
The result of an action the person tookToast

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 or ActivityInboxSelectionCount and 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

StateUse for
LoadingSkeleton rows in the shape of inbox items (Feedback)
Loading moreActivityInboxLoadingMore under the last item
EmptyAn EmptyState that says what will appear here
activity/compositions/loading-activity
activity/compositions/loading-more-activity
activity/compositions/empty-activity

Behavior

  • Open a selected item beside the list, and mark it active on 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 with aria-pressed.
  • Name the select-all checkbox (aria-label="Select all visible activity").
  • Set aria-busy on ActivityInboxPanel while it loads.

API

ActivityInboxPanel

Prop类型默认值
edgePanelEdge
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.

ActivityInboxViewport, ActivityInboxLoadingMore

接受其元素的全部属性。

ActivityInboxSidebar

Prop类型默认值
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.

ActivityInboxControls, ActivityInboxSelectionToolbar, ActivityInboxSelectionCount

接受其元素的全部属性。