react-resource-view
Feed
A journal: dated events, by day, along a thread.
A feed is a journal: a sequence of dated events, read from top to bottom, the most recent first. It suits what an application records rather than what a person plans — an activity log, an audit trail, a deployment history, the comments under a ticket.
A journal#
import { layout } from "react-resource-view"
import { MessageSquare, Rocket } from "lucide-react"
layouts: [
layout.feed<Event>({
dateField: "createdAt", // where an event sits on the thread
titleField: "summary", // the sentence
descriptionField: "detail", // the line under it
actorField: "actor", // who did it: a name, or { name }
avatarField: "avatar", // their picture; initials without one
typeField: "kind", // which marker an event gets…
types: { // …an icon and a colour per value
deploy: { icon: Rocket, color: "var(--color-view)" },
comment: { icon: MessageSquare },
},
order: "desc", // the most recent first, the default
}),
]Coming with the next release
layout.feed() ships in react-resource-view 2.3.0. This site runs on the version npm serves, so the live demo appears here once that version is published.
Events are gathered by day under a heading — Today, Yesterday, then the date written out — along a vertical thread with a marker each. A click on an event opens the record's read view, where that view says (update when read is not permitted). Filters, search, saved views and pagination work as on any other layout.
Options#
| Name | Type | Default | Description |
|---|---|---|---|
dateField | string | "createdAt" | The field the event is dated by: an ISO string, a timestamp or a Date. A record without a readable date closes the feed, under No date. |
titleField | string | the view's titleField | The title of an event, or its sentence. |
descriptionField | string | — | A secondary text under the title. |
actorField | string | — | Who did it: a string, or an object holding a name, title or label. |
avatarField | string | — | The actor's picture — an URL or a media object. Their initials stand in when there is none. |
typeField | string | — | The field whose value picks the marker, with types. |
types | Record<string, { icon?, color? }> | — | An icon and a CSS colour per value of typeField. A dot, without one. |
order | "desc" | "asc" | "desc" | The most recent first, or the oldest. |
How it reads#
- The time is relative — “5 minutes ago” — and the full date is its tooltip and what a screen reader says. Both follow the
dateLocaleport. - Every label — Today, Yesterday, No date — goes through the library's i18n.
- Pagination is the list's own: the feed shows the page on screen, and the days of the next page join it as it loads.
import { fr } from "date-fns/locale"
import { configurePorts } from "react-resource-view"
// "Hier", "il y a 5 minutes", « mardi 3 mars 2026 »
configurePorts({ dateLocale: fr })Keyboard and screen readers#
The days are a list, and the events of each day a list inside it, so a screen reader announces how many there are. Each day is headed by an h3; each date is a <time> with its machine-readable value; the title of an event is a real link, reached with Tab and opened with Enter, and a click anywhere on the event follows it.
Not the timeline#
Two different things over time
layout.timeline() draws bars over periods, Gantt-style, to plan work. layout.feed() lists events that have happened, one after the other. The first answers “is room B free on Tuesday”, the second “what happened this week”.