Data Display

ActivityItem

Displays a single activity or notification item with avatar, title, description, timestamp, and optional status indicator.

Overview

The ActivityItem component is designed for activity feeds, notification lists, and timeline events. It displays a consistent format with avatar, title, description, timestamp, and optional status indicators.

JD
John Doe2 hours ago
Updated the patient record
SS
Sarah Smith4 hours ago
Added a new note

Props

Prop Type Default Description
title ReactNode - Primary text/title (required)
avatar ReactNode - Avatar or icon to display
description ReactNode - Secondary description text
timestamp string - Time indicator (e.g., "2 hours ago")
action ReactNode - Action button or link
unread boolean false Highlights item as unread
type 'default' | 'success' | 'warning' | 'error' | 'info' 'default' Activity type for status indicator

Variants

Activity Types

Different types add a colored status indicator to convey meaning.

Default activityNow
No status indicator
Task completed1h ago
All items checked off
Attention needed2h ago
Review pending items
Error occurred3h ago
Failed to sync data
New information4h ago
System update available
<ActivityItem title="..." type="default" />
<ActivityItem title="..." type="success" />
<ActivityItem title="..." type="warning" />
<ActivityItem title="..." type="error" />
<ActivityItem title="..." type="info" />

Examples

Basic Activity

Task completedJust now
<ActivityItem
  title="Task completed"
  timestamp="Just now"
/>

With Avatar

EC
Emily Chen30 minutes ago
Scheduled a follow-up appointment
<ActivityItem
  avatar={<Avatar name="Emily Chen" size="sm" />}
  title="Emily Chen"
  description="Scheduled a follow-up appointment"
  timestamp="30 minutes ago"
/>

Unread Notification

The unread prop highlights the item with a subtle background.

SY
New message received5 minutes ago
You have 3 unread messages
<ActivityItem
  title="New message received"
  description="You have 3 unread messages"
  unread
  type="info"
/>

With Action Button

PE
Approval required1 hour ago
Dr. Johnson requested access to records
<ActivityItem
  title="Approval required"
  description="Dr. Johnson requested access"
  timestamp="1 hour ago"
  type="warning"
  action={<Button size="sm" role="secondary" label="Review" />}
/>

Activity Feed

Multiple ActivityItems stacked create an activity feed.

AR
Alex Rivera10 min ago
Created a new patient profile
JL
Jordan Lee25 min ago
Updated billing information
ST
Sam Taylor1 hour ago
Cancelled appointment #4521
SY
System2 hours ago
Automatic backup completed

Accessibility

  • Semantic Structure: Each activity item uses appropriate heading hierarchy and descriptive text.
  • Unread Indication: Unread status is conveyed visually with a distinct background color.
  • Status Colors: Status type colors are supplemented by positioning to not rely solely on color.
  • Action Accessibility: Action buttons within items are fully keyboard accessible.

Best Practices

  • Use meaningful titles that describe the activity
  • Provide relative timestamps for recent activity (e.g., "2 hours ago")
  • Use status types consistently across your application
  • Keep descriptions concise and scannable