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 Doe
Updated the patient recordSS
Sarah Smith
Added a new noteProps
| 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 activity
No status indicatorTask completed
All items checked offAttention needed
Review pending itemsError occurred
Failed to sync dataNew information
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 completed
<ActivityItem
title="Task completed"
timestamp="Just now"
/> With Avatar
EC
Emily Chen
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 received
You have 3 unread messages<ActivityItem
title="New message received"
description="You have 3 unread messages"
unread
type="info"
/> With Action Button
PE
Approval required
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 Rivera
Created a new patient profileJL
Jordan Lee
Updated billing informationST
Sam Taylor
Cancelled appointment #4521SY
System
Automatic backup completedAccessibility
- 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