Skip to content
English
Notifications inbox comes with Pro. Its preview shows once you unlock it.

Usage

import { DashboardInbox } from './DashboardInbox.jsx'

// Without items the inbox shows its sample morning. Wire it to yours; an item of your own kind
// brings its tag, badge icon and action words:
<DashboardInbox
  locale="en"
  items={inbox.items}      // [{ id, kind, from, title, body, at, unread?, detail?, tag?, icon?, actionLabel?, actionDone? }]
  onOpen={(item) => inbox.open(item.id)}
  onMarkRead={(item, read) => inbox.mark(item.id, read)}
  onMarkAllRead={() => inbox.markAllRead()}
  onArchive={(item) => inbox.archive(item.id)}   // called once the undo has run out
  onAction={(item, reply) => inbox.act(item, reply)}   // the reading pane's main button (reply: the text typed for a mention); may return a promise
  loading={inbox.loading}
  error={inbox.error}
  onRetry={inbox.reload}
/>

Props

PropTypeDefaultWhat it does
locale'en' | 'zh-CN' | 'es' | 'ja''en'Language of the built-in text, the sample messages and the time format.
itemsArray<{ id, kind, from, title, body, at, unread?, detail?, tag?, icon?, actionLabel?, actionDone? }>sample morningNewest first. kind 'mention' gets the reply box; 'order', 'stock' and 'team' have built-in tags, badges and actions, and any other kind takes the item's own: tag (the label), icon (badge: a kit icon name or a node), actionLabel and actionDone (the main button before and after). at is a date or date string; detail is a list of [label, value] pairs shown as a small receipt.
nowDate | stringnowWhat counts as today, for the Today and Yesterday headings.
onOpen / onMarkRead(item) => void / (item, read) => void—A message was opened (it is marked read), or marked read or unread with its row tool.
onMarkAllRead() => void—Everything was marked read.
onArchive(item) => void—A message was archived and its undo ran out or was dismissed. Undo puts it back without calling this.
onAction(item, reply) => Promise | void—The reading pane’s main button (Reply, Open order…), with the reply typed in the pane for a mention. The button waits while the promise runs.
loadingbooleanfalseShows the skeleton of the inbox.
error / onRetryboolean | string / () => voidfalseShows the error banner with a retry button; a string replaces its sentence.
labelsobject—Replaces any built-in text (keys as in copy.js).
classNamestring—Extra class on the root element.

Add it to your project

Pro includes the full source of this block. Copy its prompt to install it with your coding agent.

DashboardInbox.jsxdashboard-inbox.csscopy.jskit.jsxkit.cssui/base-button/ui/empty-state/ui/alert-banner/ui/undo-snackbar/ui/skeleton-shimmer/ui/sliding-tabs/tokens.cssREADME.md

The block, its stylesheet and text, the shared kit, the components it uses and tokens.css install together into one folder.