Skip to Content
ComponentsActivityFeed

ActivityFeed

Show a timeline of user activity — comments, uploads and status changes — built from ActivityItem rows with optional ActivityContent blocks.

Import

import { ActivityItem, ActivityContent, Avatar } from "@raydenui/ui";

Usage

Basic

Every row needs an avatar and text. text takes nodes, so names and links can be emphasised inline.

Preview
DA
David left a comment on Site redesign
Thurs 21, 2023
10 mins
<ActivityItem avatar={<Avatar type="initials" initials="DA" size="sm" />} text={ <> <span className="font-medium text-grey-700">David</span> left a comment on{" "} <span className="font-medium text-primary-400">Site redesign</span> </> } date="Thurs 21, 2023" time="10 mins" />

Unread

unread marks a row as not yet seen.

Preview
MO
Moyo assigned you a task
Unread
5 mins
<ActivityItem avatar={<Avatar type="initials" initials="MO" size="sm" />} text={ <> <span className="font-medium text-grey-700">Moyo</span> assigned you a task </> } time="5 mins" unread />

link renders a single action in the meta row; badge adds a short label beside it.

Preview
<ActivityItem avatar={<Avatar type="initials" initials="AD" size="sm" />} text={ <> <span className="font-medium text-grey-700">Ada</span> requested a review </> } time="10 mins" link={{ label: "View request", onClick: () => {} }} badge="#Marketing-Design" />

With a content block

Pass ActivityContent as children to attach a file, image or message block.

Preview
DA
David uploaded a file
2 hours
Project brief.pdf13MB
PDF File11 Sept 23
<ActivityItem avatar={<Avatar type="initials" initials="DA" size="sm" />} text={ <> <span className="font-medium text-grey-700">David</span> uploaded a file </> } time="2 hours" > <ActivityContent variant="file" icon="file-alt" title="Project brief.pdf" size="13MB" fileType="PDF File" date="11 Sept 23" /> </ActivityItem>

Timeline

connector draws the vertical line between rows. Use "top" for the first row, "middle" for the ones between and "last" for the final row.

Preview
DA
Created the project
Just now
MO
Added three collaborators
2 mins
AD
Published the first draft
5 mins
<div className="flex flex-col"> <ActivityItem avatar={<Avatar type="initials" initials="DA" size="sm" />} text="Created the project" time="Just now" connector="top" /> <ActivityItem avatar={<Avatar type="initials" initials="MO" size="sm" />} text="Added three collaborators" time="2 mins" connector="middle" /> <ActivityItem avatar={<Avatar type="initials" initials="AD" size="sm" />} text="Published the first draft" time="5 mins" connector="last" /> </div>

Props

ActivityItem

PropTypeDefaultDescription
avatarReactNode—Avatar element (required)
textReactNode—Primary text content (required)
unreadbooleanfalseShows the unread dot
datestring—Date label
timestring—Time label, right-aligned
link{ label: string; href?: string; onClick?: () => void }—Link button in the meta row
badgestring—Badge text in the meta row
connector"top" | "middle" | "last"—Connector line for timeline layouts
childrenReactNode—Content block, e.g. ActivityContent

ActivityContent

PropTypeDefaultDescription
variantActivityContentVariant—Content variant (required)
contentStyleActivityContentStyle—Visual style wrapper
iconReactNode | IconName—Leading icon, file variant
titlestring—File name
sizestring—File size
fileTypestring—File type label
datestring—File date

Accessibility

  • Put the actor and the action in text so the row reads as a sentence; do not rely on the avatar alone to say who acted.
  • Give the Avatar an alt describing the person.
  • Use link rather than making the whole row clickable, so the action is reachable by keyboard and has a name.
Last updated on