Skip to content
Brok UI

Loading…

No results

Activity Feed

Open source

In-app activity feeds — a timeline of events with avatars, action text and timestamps.

Preview

resources/views/blocks/activity-feed-grouped.blade.php Blade
@props([
    'title'  => 'Activity',
    'groups' => null,
])

@php
    $groups ??= [
        ['label' => 'Today', 'events' => [
            ['type' => 'avatar', 'initials' => 'PR', 'actor' => 'Priya Raj', 'action' => 'approved', 'target' => 'Design system v2', 'targetVariant' => 'default', 'time' => '9:41 am'],
            ['type' => 'avatar', 'initials' => 'MW', 'actor' => 'Marcus Webb', 'action' => 'commented on', 'target' => 'Sprint planning', 'targetVariant' => 'secondary', 'time' => '8:05 am'],
            ['type' => 'icon', 'icon' => 'deploy', 'actor' => 'CI / CD', 'action' => 'deployed to', 'target' => 'Production', 'targetVariant' => 'outline', 'time' => '7:30 am'],
        ]],
        ['label' => 'Yesterday', 'events' => [
            ['type' => 'avatar', 'initials' => 'AO', 'actor' => 'Aisha Okonkwo', 'action' => 'merged', 'target' => 'feat/onboarding', 'targetVariant' => 'secondary', 'time' => '6:12 pm'],
            ['type' => 'icon', 'icon' => 'alert', 'actor' => 'Error monitor', 'action' => 'flagged issue in', 'target' => 'Auth service', 'targetVariant' => 'destructive', 'time' => '2:48 pm'],
        ]],
        ['label' => 'Mar 12', 'events' => [
            ['type' => 'avatar', 'initials' => 'DK', 'actor' => 'Dev Kapoor', 'action' => 'created', 'target' => 'Q2 roadmap', 'targetVariant' => 'outline', 'time' => '11:00 am'],
        ]],
    ];
    $iconPaths = ['deploy' => 'M12 2 2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5', 'alert' => 'M12 9v4m0 4h.01M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'];
@endphp

<x-ui.section space="md" {{ $attributes }}>
    <x-ui.container size="sm" gutter="sm">
        <x-ui.card>
            <div class="border-b border-border px-6 py-4"><h2 class="text-base font-semibold leading-6">{{ __($title) }}</h2></div>
            <div class="divide-y divide-border">
                @foreach ($groups as $group)
                    <div class="px-6 py-6">
                        <p class="mb-4 text-xs font-semibold uppercase tracking-widest text-muted-foreground">{{ __($group['label']) }}</p>
                        <ol class="border-s border-border ps-4">
                            @foreach ($group['events'] as $event)
                                <li class="relative flex items-start gap-x-4 {{ $loop->last ? '' : 'mb-6' }}">
                                    <span class="absolute -start-[1.3125rem] top-2 size-2 rounded-full border-2 border-border bg-background" aria-hidden="true"></span>
                                    @if ($event['type'] === 'avatar')
                                        <x-ui.avatar size="sm" :alt="$event['actor']" :fallback="$event['initials'] ?? ''" />
                                    @else
                                        <span class="inline-flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground" aria-hidden="true">
                                            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="size-4" aria-hidden="true"><path d="{{ $iconPaths[$event['icon']] ?? $iconPaths['deploy'] }}" /></svg>
                                        </span>
                                    @endif
                                    <div class="min-w-0 flex-1 pt-2">
                                        <p class="text-sm leading-snug">
                                            <span class="font-medium text-foreground">{{ $event['actor'] }}</span>
                                            <span class="text-muted-foreground"> {{ __($event['action']) }} </span>
                                            @if (! empty($event['target']))<x-ui.badge :variant="$event['targetVariant'] ?? 'secondary'" size="sm">{{ $event['target'] }}</x-ui.badge>@endif
                                        </p>
                                        <p class="mt-0.5 text-xs text-muted-foreground"><time>{{ $event['time'] }}</time></p>
                                    </div>
                                </li>
                            @endforeach
                        </ol>
                    </div>
                @endforeach
            </div>
        </x-ui.card>
    </x-ui.container>
</x-ui.section>

Installation

terminal
php artisan ui:add blocks/activity-feed-grouped

Installs these dependencies automatically:

Registry contract

Install confidence

php artisan ui:add blocks/activity-feed-grouped writes only the generated targets below. The CLI validates each file hash before writing and prompts before replacing local changes unless --force is used.

Version
1.0.4
License
open
Stability
stable
Contract
v1
Foundation
≥ 1.0.0
Type Generated target
blade resources/views/blocks/activity-feed-grouped.blade.php

Registry dependencies

avatar badge card container section

Package dependencies

composer: jml/brok:^0.2

Use with AI

A brief for your coding agent: what the block is, the install command, how to render it, its props and the rules. Copy it, or open a prompt about this block in an assistant.

activity-feed-grouped.md
# Brok UI block: Activity Feed Grouped (`activity-feed-grouped`)

An activity feed grouped under day headers, each day a rail of avatar/icon events with target badges and times.

Brok UI is a Laravel Blade registry. `ui:add` copies this block into the app as plain Blade the app owns; it composes installed `<brok:*>` primitives and semantic design tokens.

## Install

```bash
php artisan ui:add blocks/activity-feed-grouped
```

## Render it

```blade
<x-blocks.activity-feed-grouped />
```

## Props

- `title` (string, default `Activity`)
- `groups` (mixed|null, default `null`)

## Use when

- Grouping activity events under day headers (Today, Yesterday, a date) with an avatar or icon rail per row.
- Mixing person-driven events (avatar) with system events (icon) in the same feed.

## Avoid when

- Use activity-feed-timeline for a single ungrouped timeline, or activity-feed-compact for a dense audit-log table.

## Rules

- Render the installed block with `<x-blocks.activity-feed-grouped />` and pass data through its props; edit the copied file only for structural changes.
- Keep the semantic design tokens (`bg-background`, `text-muted-foreground`); never swap in raw colour utilities.
- Keep the `data-slot` attributes and the logical (start/end) spacing so the markup still mirrors under `dir="rtl"`.

## Links

- Docs: https://brokui.dev/blocks/activity-feed-grouped
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/activity-feed-grouped.json

Working in Claude Code, Cursor or Codex? Give the agent the whole registry through the MCP server or the Brok UI skill.

Guidance

Use when

  • Grouping activity events under day headers (Today, Yesterday, a date) with an avatar or icon rail per row.
  • Mixing person-driven events (avatar) with system events (icon) in the same feed.

Avoid when

  • Use activity-feed-timeline for a single ungrouped timeline, or activity-feed-compact for a dense audit-log table.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.

Usage

Render the block as a component, passing data where useful:

resources/views/welcome.blade.php Blade
<x-blocks.activity-feed-grouped />

Built from primitives

Composes <brok:*> Semantic tokens Re-themeable RTL-ready

This block composes installed <brok:*> primitives and semantic design tokens only — it does not reimplement any primitive. Re-theme it (light, dark, admin, customer) by editing CSS variables; flip the preview to RTL to confirm it mirrors.

Source

The exact, editable file ui:add writes into your app. The preview above renders this same source — there are no preview-only blocks.

resources/views/blocks/activity-feed-grouped.blade.php Blade
@props([
    'title'  => 'Activity',
    'groups' => null,
])

@php
    $groups ??= [
        ['label' => 'Today', 'events' => [
            ['type' => 'avatar', 'initials' => 'PR', 'actor' => 'Priya Raj', 'action' => 'approved', 'target' => 'Design system v2', 'targetVariant' => 'default', 'time' => '9:41 am'],
            ['type' => 'avatar', 'initials' => 'MW', 'actor' => 'Marcus Webb', 'action' => 'commented on', 'target' => 'Sprint planning', 'targetVariant' => 'secondary', 'time' => '8:05 am'],
            ['type' => 'icon', 'icon' => 'deploy', 'actor' => 'CI / CD', 'action' => 'deployed to', 'target' => 'Production', 'targetVariant' => 'outline', 'time' => '7:30 am'],
        ]],
        ['label' => 'Yesterday', 'events' => [
            ['type' => 'avatar', 'initials' => 'AO', 'actor' => 'Aisha Okonkwo', 'action' => 'merged', 'target' => 'feat/onboarding', 'targetVariant' => 'secondary', 'time' => '6:12 pm'],
            ['type' => 'icon', 'icon' => 'alert', 'actor' => 'Error monitor', 'action' => 'flagged issue in', 'target' => 'Auth service', 'targetVariant' => 'destructive', 'time' => '2:48 pm'],
        ]],
        ['label' => 'Mar 12', 'events' => [
            ['type' => 'avatar', 'initials' => 'DK', 'actor' => 'Dev Kapoor', 'action' => 'created', 'target' => 'Q2 roadmap', 'targetVariant' => 'outline', 'time' => '11:00 am'],
        ]],
    ];
    $iconPaths = ['deploy' => 'M12 2 2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5', 'alert' => 'M12 9v4m0 4h.01M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'];
@endphp

<x-ui.section space="md" {{ $attributes }}>
    <x-ui.container size="sm" gutter="sm">
        <x-ui.card>
            <div class="border-b border-border px-6 py-4"><h2 class="text-base font-semibold leading-6">{{ __($title) }}</h2></div>
            <div class="divide-y divide-border">
                @foreach ($groups as $group)
                    <div class="px-6 py-6">
                        <p class="mb-4 text-xs font-semibold uppercase tracking-widest text-muted-foreground">{{ __($group['label']) }}</p>
                        <ol class="border-s border-border ps-4">
                            @foreach ($group['events'] as $event)
                                <li class="relative flex items-start gap-x-4 {{ $loop->last ? '' : 'mb-6' }}">
                                    <span class="absolute -start-[1.3125rem] top-2 size-2 rounded-full border-2 border-border bg-background" aria-hidden="true"></span>
                                    @if ($event['type'] === 'avatar')
                                        <x-ui.avatar size="sm" :alt="$event['actor']" :fallback="$event['initials'] ?? ''" />
                                    @else
                                        <span class="inline-flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground" aria-hidden="true">
                                            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="size-4" aria-hidden="true"><path d="{{ $iconPaths[$event['icon']] ?? $iconPaths['deploy'] }}" /></svg>
                                        </span>
                                    @endif
                                    <div class="min-w-0 flex-1 pt-2">
                                        <p class="text-sm leading-snug">
                                            <span class="font-medium text-foreground">{{ $event['actor'] }}</span>
                                            <span class="text-muted-foreground"> {{ __($event['action']) }} </span>
                                            @if (! empty($event['target']))<x-ui.badge :variant="$event['targetVariant'] ?? 'secondary'" size="sm">{{ $event['target'] }}</x-ui.badge>@endif
                                        </p>
                                        <p class="mt-0.5 text-xs text-muted-foreground"><time>{{ $event['time'] }}</time></p>
                                    </div>
                                </li>
                            @endforeach
                        </ol>
                    </div>
                @endforeach
            </div>
        </x-ui.card>
    </x-ui.container>
</x-ui.section>

Ownership & lifecycle

Owner, release state, review evidence and adoption for this item.
Owner
Platform UI (@JoshJML)
Current version
1.0.4
Status
Stable
License
open
Deprecation
Not deprecated
Contract
v1
Foundation
≥ 1.0.0