Skip to main content

Activity feed Pro

What happened, newest first: who did what to what, and when, as GitHub, Linear and Notion show it. Entries are headed by day, filtered by kind with chips, show unread dots with Mark all as read, quote comments, and page in older activity with Load more. Each entry is read as one sentence ("Maya commented on Q3 roadmap, 12 minutes ago"), and names and targets can be links.

import { ActivityFeed } from '@patine-ui/pro';
Loading…
<ActivityFeed items={activity} title="Activity" onMarkAllRead={() => {}} style={{ width: 420 }} />

Try the props​

Props
variant
timeFormat
density
design
<ActivityFeed
items={activity}
title="Activity"
onMarkAllRead={markAllRead}
/>

Example: a deal's history​

A CRM's deal page: every email, call and stage change on one timeline, grouped by day. Pressing an entry opens it in the panel below.

Loading…
<View style={{ width: '100%', maxWidth: 480, gap: 12 }}>
  <ActivityFeed items={HISTORY} title="Northwind · €48k" onItemPress={setOpen} />
  {open ? (
    <Box border radius="lg" padding="md" gap="xs">
      <Text weight="semibold">{[open.actor?.name, open.action, open.target].filter(Boolean).join(' ')}</Text>
      <Text color="textSecondary">{open.content ?? open.meta ?? 'No notes on this entry.'}</Text>
    </Box>
  ) : null}
</View>

Entries​

Each item is { id, actor?, action, target?, timestamp, icon?, color?, type?, content?, unread?, meta? }. With an actor the entry shows their avatar with the icon badged on it; without one (a deploy, a payment) it shows the icon in a tinted circle. A string content is quoted under the sentence, cut after contentLines; any node is drawn as it is.

Filters, unread and paging​

filters shows chips above the feed; an entry shows under a filter when its type matches, and the first filter (usually 'all') shows everything. filter and onFilterChange control it. While anything is unread, the title shows the count and onMarkAllRead adds Mark all as read. hasMore with onLoadMore (and loadingMore) pages in older activity.

Loading…
<ActivityFeed
  items={items}
  title="Team activity"
  filters={filters}
  onMarkAllRead={() => setItems((list) => list.map((i) => ({ ...i, unread: false })))}
  hasMore={items.length < 7}
  loadingMore={loading}
  onLoadMore={loadMore}
  onActorPress={(item) => alert(item.actor.name)}
  style={{ width: 440 }}
/>

Variants​

variant is 'timeline' (avatars joined by a line), 'list' (rows split by hairlines) or 'cards'. groupByDay={false} drops the day headings, and timeFormat shows 'relative' (default), 'time' or 'datetime' times.

Loading…
<View style={{ flexDirection: 'row', gap: 24, flexWrap: 'wrap' }}>
  <ActivityFeed items={payments} variant="list" groupByDay={false} style={{ width: 340 }} />
  <ActivityFeed items={payments} variant="cards" timeFormat="time" groupByDay={false} density="compact" style={{ width: 340 }} />
</View>

Props​

PropTypeDefaultDescription
itemsActivityItem[]—{ id, actor?: { name, avatar? }, action, target?, timestamp, icon?, color?, type?, content?, unread?, meta? }
variant'timeline' | 'list' | 'cards''timeline'
titlestring—A title with the unread count.
groupByDaybooleantrue
timeFormat'relative' | 'time' | 'datetime''relative'
locale / hour12 / now
filters / filter / defaultFilter / onFilterChangeFilter chips by type.
contentLinesnumber3
onItemPress / onActorPress / onTargetPress(item) => void—
onMarkAllRead() => void—
hasMore / loadingMore / onLoadMoreLoad more.
renderItem(info) => ReactNode—
loading / error / onRetry / emptyTitle / emptyDescription / renderEmptyStates.
density / animate / labels / design / theme / accessibilityLabel / style