Skip to content
h v3.13.3
Search the docs
Find a component, section or page.

Threaded inbox

One thread per task, project or doc, with filters, j and k to move, u to read, h to snooze and the agent's ask pinned on top.

Send the Brightwell Studio quote To do

TSK-12

Needs you.

Send the Brightwell Studio quote

Decision

Quote 14 templates at the mid tier, valid for 30 days.

Quote agent Contract workflow Thu 08:15 72% sure

Missing: They never confirmed the office count.

jk move u read h snooze adse approve, decline, steer, edit

Installation

pnpm add @heyramzi/ui

Usage

import { ThreadInbox, type InboxEntry, type InboxSubject } from "@heyramzi/ui/inbox";
<ThreadInbox
  {entries}
  bind:selected
  unreadFirst
  onRead={(thread, read) => markThread(thread.key, read)}
/>

Keyboard and accessibility

Key Does
j Opens the next thread and focuses its row.
k Opens the previous thread and focuses its row.
u Marks the open thread read, or unread.
Alt U Marks every thread read.
h Opens the snooze choices, or brings a snoozed thread back.
1 2 3 With snooze open, snoozes for 3 hours, until 9:00 tomorrow or until 9:00 next Monday.
Esc Closes the snooze choices.
Shift S Unfollows the open thread.
Backspace Clears the open thread and opens the next one. A thread waiting on a decision stays.
Shift Backspace Clears every thread that's read and waits on nothing.
a d s e On a pending proposal: approve, decline, steer or edit the draft.
  • The keys work only while focus is inside the inbox, and never while you type in a field.
  • A key does nothing unless the host passes its handler, like onReadAll for Alt+U or onClear for Backspace.
  • The buttons announce their keys through aria-keyshortcuts.
  • Threads are a list, and the open row reports itself as current.
  • The key hints under the inbox are hidden on a phone.

API reference

entries required InboxEntry[]
selected bindable string
The key of the open thread. Without a match the first thread opens.
unreadFirst boolean
Default false
Threads with unread entries come first.
labels Partial<InboxLabels>
typeLabels Record<string, string>
Default {}
Display names for subject types, such as `{ task: "Tasks" }`. A missing type shows as written.
avatar Snippet<[InboxActor]>
Replaces the default avatar for a person or an agent, drawn in a 24px slot.
status Snippet<[InboxSubject]>
A badge for the subject's status, drawn by the host with its own status map.
renderProposal Snippet<[InboxItem]>
Replaces a pinned proposal's summary lines.
attachments Snippet<[InboxEntry]>
Content under an entry's text, such as links to what it mentions.
threadLabels Partial<ThreadLabels>
The words of the thread under the pinned card, such as its "Activity" heading.
when (at: string) => string
Default (at) => whenOf(at)
How a timestamp reads. Defaults to a relative time.
onSelect (thread: InboxThread) => void
onRead (thread: InboxThread, read: boolean) => void
`read` is true when the thread had unread entries, so the host marks them all read.
onReadAll () => void
Alt+U: mark every thread read.
onSnooze (request: InboxSnooze) => void
showSnoozed boolean
Default false
The host is passing snoozed threads too, each with `subject.snoozedUntil`.
onShowSnoozed (show: boolean) => void
Adds "Show snoozed" to the filter. The host passes the snoozed entries or stops.
onUnsnooze (thread: InboxThread) => void
`h` on a snoozed thread brings it back now.
onUnfollow (thread: InboxThread) => void
Shift+S on a thread whose `subject.followed` is set.
onClear (thread: InboxThread) => void
Backspace: take the thread out of the inbox. The host stops passing its entries, and new activity can bring it back. A thread holding a pending proposal can't be cleared.
onClearRead (threads: InboxThread[]) => void
Shift+Backspace: clear every thread with nothing unread and no pending proposal.
onDecide (verdict: InboxVerdict, thread: InboxThread) => void
class string
Prop Type Default
entries required InboxEntry[]
selected bindable

The key of the open thread. Without a match the first thread opens.

string
unreadFirst

Threads with unread entries come first.

boolean false
labels Partial<InboxLabels>
typeLabels

Display names for subject types, such as `{ task: "Tasks" }`. A missing type shows as written.

Record<string, string> {}
avatar

Replaces the default avatar for a person or an agent, drawn in a 24px slot.

Snippet<[InboxActor]>
status

A badge for the subject's status, drawn by the host with its own status map.

Snippet<[InboxSubject]>
renderProposal

Replaces a pinned proposal's summary lines.

Snippet<[InboxItem]>
attachments

Content under an entry's text, such as links to what it mentions.

Snippet<[InboxEntry]>
threadLabels

The words of the thread under the pinned card, such as its "Activity" heading.

Partial<ThreadLabels>
when

How a timestamp reads. Defaults to a relative time.

(at: string) => string (at) => whenOf(at)
onSelect (thread: InboxThread) => void
onRead

`read` is true when the thread had unread entries, so the host marks them all read.

(thread: InboxThread, read: boolean) => void
onReadAll

Alt+U: mark every thread read.

() => void
onSnooze (request: InboxSnooze) => void
showSnoozed

The host is passing snoozed threads too, each with `subject.snoozedUntil`.

boolean false
onShowSnoozed

Adds "Show snoozed" to the filter. The host passes the snoozed entries or stops.

(show: boolean) => void
onUnsnooze

`h` on a snoozed thread brings it back now.

(thread: InboxThread) => void
onUnfollow

Shift+S on a thread whose `subject.followed` is set.

(thread: InboxThread) => void
onClear

Backspace: take the thread out of the inbox. The host stops passing its entries, and new activity can bring it back. A thread holding a pending proposal can't be cleared.

(thread: InboxThread) => void
onClearRead

Shift+Backspace: clear every thread with nothing unread and no pending proposal.

(threads: InboxThread[]) => void
onDecide (verdict: InboxVerdict, thread: InboxThread) => void
class string