Dashboard
Full dashboard screens — KPI stats, charts, tables and activity feeds across finance, commerce, support, analytics and observability.
Preview
@props([
'greeting' => 'Good morning, Jordan',
'subtitle' => 'Here is your performance summary for the last 30 days.',
'stats' => null,
'series' => null,
'categories' => null,
'invoices' => null,
])
@php
$stats ??= [
['label' => 'Revenue', 'value' => '$48,200', 'delta' => '+12.5%', 'description' => 'vs last month'],
['label' => 'Subscriptions', 'value' => '1,284', 'delta' => '+4.1%', 'description' => 'vs last month'],
['label' => 'Active users', 'value' => '8,942', 'delta' => '+9.3%', 'description' => 'vs last month'],
['label' => 'Churn', 'value' => '1.8%', 'delta' => '-0.4%', 'description' => 'vs last month'],
];
$series ??= [
['name' => __('This year'), 'data' => [18200, 22400, 21000, 27800, 31200, 29600, 35400, 38800, 36200, 42600, 45800, 48200]],
['name' => __('Last year'), 'data' => [14800, 17600, 18200, 21400, 24200, 23800, 27200, 29400, 28600, 31800, 34200, 36400]],
];
$categories ??= [
__('Jan'), __('Feb'), __('Mar'), __('Apr'), __('May'), __('Jun'),
__('Jul'), __('Aug'), __('Sep'), __('Oct'), __('Nov'), __('Dec'),
];
$invoices ??= [
['id' => 'INV-2043', 'customer' => 'Olivia Hart', 'initials' => 'OH', 'amount' => '$1,920.00', 'status' => 'Paid', 'tone' => 'success'],
['id' => 'INV-2042', 'customer' => 'Marcus Lee', 'initials' => 'ML', 'amount' => '$840.00', 'status' => 'Pending', 'tone' => 'warning'],
['id' => 'INV-2041', 'customer' => 'Priya Nair', 'initials' => 'PN', 'amount' => '$2,460.00', 'status' => 'Paid', 'tone' => 'success'],
['id' => 'INV-2040', 'customer' => 'Tom Becker', 'initials' => 'TB', 'amount' => '$310.00', 'status' => 'Overdue', 'tone' => 'destructive'],
];
// ApexCharts needs concrete colours; reference the semantic tokens via their CSS
// variables so the chart still tracks the active theme (this is chart config, not markup).
$chartOptions = [
'colors' => ['var(--chart-1-color, hsl(var(--chart-1)))', 'var(--chart-2-color, hsl(var(--chart-2)))'],
'chart' => [
'toolbar' => ['show' => false],
'zoom' => ['enabled' => false],
'fontFamily' => 'inherit',
],
'stroke' => ['curve' => 'smooth', 'width' => 2],
'dataLabels' => ['enabled' => false],
'fill' => [
'type' => 'gradient',
'gradient' => ['shadeIntensity' => 1, 'opacityFrom' => 0.4, 'opacityTo' => 0.05, 'stops' => [0, 90, 100]],
],
'grid' => ['borderColor' => 'var(--border-color, hsl(var(--border)))', 'strokeDashArray' => 4],
'legend' => ['show' => true, 'labels' => ['colors' => 'var(--muted-foreground-color, hsl(var(--muted-foreground)))']],
'xaxis' => [
'categories' => $categories,
'axisBorder' => ['show' => false],
'axisTicks' => ['show' => false],
'labels' => ['style' => ['colors' => 'var(--muted-foreground-color, hsl(var(--muted-foreground)))']],
],
'yaxis' => ['labels' => ['style' => ['colors' => 'var(--muted-foreground-color, hsl(var(--muted-foreground)))']]],
];
@endphp
<main id="main-content" data-surface="admin" data-visual-contracts="VC-007" {{ $attributes->merge(['class' => 'min-h-svh bg-background p-4 text-foreground sm:p-6 lg:p-8']) }}>
<div class="mx-auto max-w-7xl space-y-6">
{{-- Welcome header --}}
<div class="flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
<div>
<h1 class="text-2xl font-bold tracking-tight">{{ __($greeting) }}</h1>
<p class="mt-2 text-muted-foreground">{{ __($subtitle) }}</p>
</div>
<div class="flex gap-2">
<x-ui.button variant="outline" size="sm">
<svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/></svg>
{{ __('Last 30 days') }}
</x-ui.button>
<x-ui.button size="sm">{{ __('Export') }}</x-ui.button>
</div>
</div>
{{-- KPI stat row --}}
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
@foreach ($stats as $stat)
<x-ui.stat
:label="__($stat['label'])"
:value="$stat['value']"
:delta="$stat['delta']"
:description="__($stat['description'])"
/>
@endforeach
</div>
{{-- Sales chart + summary, then recent invoices --}}
<div class="grid gap-6 lg:grid-cols-[2fr_1fr]">
<x-ui.card>
<x-ui.card.header>
<x-ui.card.title>{{ __('Sales overview') }}</x-ui.card.title>
<x-ui.card.description>{{ __('Monthly revenue compared to the previous year.') }}</x-ui.card.description>
</x-ui.card.header>
<x-ui.card.content>
<x-ui.chart type="area" :series="$series" :options="$chartOptions" :height="300" :label="__('Monthly revenue area chart')" />
</x-ui.card.content>
</x-ui.card>
<x-ui.card>
<x-ui.card.header>
<x-ui.card.title>{{ __('Goal progress') }}</x-ui.card.title>
<x-ui.card.description>{{ __('Tracking toward this quarter’s targets.') }}</x-ui.card.description>
</x-ui.card.header>
<x-ui.card.content class="space-y-6 text-sm">
@foreach (['Revenue' => 76, 'New customers' => 58, 'Retention' => 91] as $label => $pct)
<div>
<div class="mb-2 flex items-center justify-between">
<span class="font-medium">{{ __($label) }}</span>
<span class="text-muted-foreground tabular-nums">{{ $pct }}%</span>
</div>
<x-ui.progress :value="$pct" :label="__(':label progress', ['label' => $label])" />
</div>
@endforeach
</x-ui.card.content>
</x-ui.card>
</div>
{{-- Recent invoices --}}
<x-ui.card>
<x-ui.card.header>
<div class="flex items-center justify-between gap-4">
<div class="space-y-2">
<x-ui.card.title>{{ __('Recent invoices') }}</x-ui.card.title>
<x-ui.card.description>{{ __('Latest billing activity across your workspace.') }}</x-ui.card.description>
</div>
<x-ui.button variant="outline" size="sm">{{ __('View all') }}</x-ui.button>
</div>
</x-ui.card.header>
<x-ui.card.content>
<x-ui.table>
<x-ui.table.header>
<x-ui.table.row>
<x-ui.table.head>{{ __('Invoice') }}</x-ui.table.head>
<x-ui.table.head>{{ __('Customer') }}</x-ui.table.head>
<x-ui.table.head>{{ __('Status') }}</x-ui.table.head>
<x-ui.table.head class="text-end">{{ __('Amount') }}</x-ui.table.head>
</x-ui.table.row>
</x-ui.table.header>
<x-ui.table.body>
@foreach ($invoices as $invoice)
<x-ui.table.row>
<x-ui.table.cell class="font-medium tabular-nums">{{ $invoice['id'] }}</x-ui.table.cell>
<x-ui.table.cell>
<span class="flex items-center gap-2">
<x-ui.avatar size="sm" :fallback="$invoice['initials']" :alt="$invoice['customer']" />
<span>{{ $invoice['customer'] }}</span>
</span>
</x-ui.table.cell>
<x-ui.table.cell>
<x-ui.badge :variant="$invoice['tone']">{{ __($invoice['status']) }}</x-ui.badge>
</x-ui.table.cell>
<x-ui.table.cell class="text-end tabular-nums">{{ $invoice['amount'] }}</x-ui.table.cell>
</x-ui.table.row>
@endforeach
</x-ui.table.body>
</x-ui.table>
</x-ui.card.content>
</x-ui.card>
</div>
</main>
Installation
php artisan ui:add pages/dashboard-overview
Registry contract
Install confidence
php artisan ui:add pages/dashboard-overview
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.2.2
- License
- open
- Stability
- stable
- Contract
- v1
- Foundation
- ≥ 1.0.0
| Type | Generated target |
|---|---|
| blade | resources/views/pages/dashboard-overview.blade.php |
Registry dependencies
Package dependencies
composer: jml/brok:^0.2
Use with AI
A brief for your coding agent: what the page is, the install command, how to render it, its props and the rules. Copy it, or open a prompt about this page in an assistant.
# Brok UI page: Dashboard (`dashboard-overview`)
A dashboard overview: a welcome header with quick actions, a KPI stat row, a sales area chart, and a recent-invoices table in a bordered grid.
Brok UI is a Laravel Blade registry. `ui:add` copies this page into the app as plain Blade the app owns; it composes installed `<brok:*>` primitives and semantic design tokens.
## Install
```bash
php artisan ui:add pages/dashboard-overview
```
## Render it
```blade
<x-pages.dashboard-overview />
```
## Use when
- An application needs an overview page combining key metrics, trend data, and recent records.
## Avoid when
- The product needs global navigation too; compose this inside app-shell-classic or another app-shell page.
- The reader must change the reporting period, compare with the previous period or export CSV; use dashboard-finance (Pro), which adds a date-range picker, a comparison switch and an export action that redraw the chart, where this page has a static header with one action.
## Rules
- Render the installed page with `<x-pages.dashboard-overview />` 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/pages/dashboard-overview
- Registry JSON (files, props, contract): https://brokui.dev/r/open/pages/dashboard-overview.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
- An application needs an overview page combining key metrics, trend data, and recent records.
Avoid when
- The product needs global navigation too; compose this inside app-shell-classic or another app-shell page.
- The reader must change the reporting period, compare with the previous period or export CSV; use dashboard-finance (Pro), which adds a date-range picker, a comparison switch and an export action that redraw the chart, where this page has a static header with one action.
Anti-patterns
- Do not replace semantic props with conflicting utility classes.
- Do not remove labels, focus styles, or state attributes.
Usage
Render the page as a component, or wire it to a route. Pass data where useful:
<x-pages.dashboard-overview />
Built from blocks & primitives
This page 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 pages.
@props([
'greeting' => 'Good morning, Jordan',
'subtitle' => 'Here is your performance summary for the last 30 days.',
'stats' => null,
'series' => null,
'categories' => null,
'invoices' => null,
])
@php
$stats ??= [
['label' => 'Revenue', 'value' => '$48,200', 'delta' => '+12.5%', 'description' => 'vs last month'],
['label' => 'Subscriptions', 'value' => '1,284', 'delta' => '+4.1%', 'description' => 'vs last month'],
['label' => 'Active users', 'value' => '8,942', 'delta' => '+9.3%', 'description' => 'vs last month'],
['label' => 'Churn', 'value' => '1.8%', 'delta' => '-0.4%', 'description' => 'vs last month'],
];
$series ??= [
['name' => __('This year'), 'data' => [18200, 22400, 21000, 27800, 31200, 29600, 35400, 38800, 36200, 42600, 45800, 48200]],
['name' => __('Last year'), 'data' => [14800, 17600, 18200, 21400, 24200, 23800, 27200, 29400, 28600, 31800, 34200, 36400]],
];
$categories ??= [
__('Jan'), __('Feb'), __('Mar'), __('Apr'), __('May'), __('Jun'),
__('Jul'), __('Aug'), __('Sep'), __('Oct'), __('Nov'), __('Dec'),
];
$invoices ??= [
['id' => 'INV-2043', 'customer' => 'Olivia Hart', 'initials' => 'OH', 'amount' => '$1,920.00', 'status' => 'Paid', 'tone' => 'success'],
['id' => 'INV-2042', 'customer' => 'Marcus Lee', 'initials' => 'ML', 'amount' => '$840.00', 'status' => 'Pending', 'tone' => 'warning'],
['id' => 'INV-2041', 'customer' => 'Priya Nair', 'initials' => 'PN', 'amount' => '$2,460.00', 'status' => 'Paid', 'tone' => 'success'],
['id' => 'INV-2040', 'customer' => 'Tom Becker', 'initials' => 'TB', 'amount' => '$310.00', 'status' => 'Overdue', 'tone' => 'destructive'],
];
// ApexCharts needs concrete colours; reference the semantic tokens via their CSS
// variables so the chart still tracks the active theme (this is chart config, not markup).
$chartOptions = [
'colors' => ['var(--chart-1-color, hsl(var(--chart-1)))', 'var(--chart-2-color, hsl(var(--chart-2)))'],
'chart' => [
'toolbar' => ['show' => false],
'zoom' => ['enabled' => false],
'fontFamily' => 'inherit',
],
'stroke' => ['curve' => 'smooth', 'width' => 2],
'dataLabels' => ['enabled' => false],
'fill' => [
'type' => 'gradient',
'gradient' => ['shadeIntensity' => 1, 'opacityFrom' => 0.4, 'opacityTo' => 0.05, 'stops' => [0, 90, 100]],
],
'grid' => ['borderColor' => 'var(--border-color, hsl(var(--border)))', 'strokeDashArray' => 4],
'legend' => ['show' => true, 'labels' => ['colors' => 'var(--muted-foreground-color, hsl(var(--muted-foreground)))']],
'xaxis' => [
'categories' => $categories,
'axisBorder' => ['show' => false],
'axisTicks' => ['show' => false],
'labels' => ['style' => ['colors' => 'var(--muted-foreground-color, hsl(var(--muted-foreground)))']],
],
'yaxis' => ['labels' => ['style' => ['colors' => 'var(--muted-foreground-color, hsl(var(--muted-foreground)))']]],
];
@endphp
<main id="main-content" data-surface="admin" data-visual-contracts="VC-007" {{ $attributes->merge(['class' => 'min-h-svh bg-background p-4 text-foreground sm:p-6 lg:p-8']) }}>
<div class="mx-auto max-w-7xl space-y-6">
{{-- Welcome header --}}
<div class="flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
<div>
<h1 class="text-2xl font-bold tracking-tight">{{ __($greeting) }}</h1>
<p class="mt-2 text-muted-foreground">{{ __($subtitle) }}</p>
</div>
<div class="flex gap-2">
<x-ui.button variant="outline" size="sm">
<svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/></svg>
{{ __('Last 30 days') }}
</x-ui.button>
<x-ui.button size="sm">{{ __('Export') }}</x-ui.button>
</div>
</div>
{{-- KPI stat row --}}
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
@foreach ($stats as $stat)
<x-ui.stat
:label="__($stat['label'])"
:value="$stat['value']"
:delta="$stat['delta']"
:description="__($stat['description'])"
/>
@endforeach
</div>
{{-- Sales chart + summary, then recent invoices --}}
<div class="grid gap-6 lg:grid-cols-[2fr_1fr]">
<x-ui.card>
<x-ui.card.header>
<x-ui.card.title>{{ __('Sales overview') }}</x-ui.card.title>
<x-ui.card.description>{{ __('Monthly revenue compared to the previous year.') }}</x-ui.card.description>
</x-ui.card.header>
<x-ui.card.content>
<x-ui.chart type="area" :series="$series" :options="$chartOptions" :height="300" :label="__('Monthly revenue area chart')" />
</x-ui.card.content>
</x-ui.card>
<x-ui.card>
<x-ui.card.header>
<x-ui.card.title>{{ __('Goal progress') }}</x-ui.card.title>
<x-ui.card.description>{{ __('Tracking toward this quarter’s targets.') }}</x-ui.card.description>
</x-ui.card.header>
<x-ui.card.content class="space-y-6 text-sm">
@foreach (['Revenue' => 76, 'New customers' => 58, 'Retention' => 91] as $label => $pct)
<div>
<div class="mb-2 flex items-center justify-between">
<span class="font-medium">{{ __($label) }}</span>
<span class="text-muted-foreground tabular-nums">{{ $pct }}%</span>
</div>
<x-ui.progress :value="$pct" :label="__(':label progress', ['label' => $label])" />
</div>
@endforeach
</x-ui.card.content>
</x-ui.card>
</div>
{{-- Recent invoices --}}
<x-ui.card>
<x-ui.card.header>
<div class="flex items-center justify-between gap-4">
<div class="space-y-2">
<x-ui.card.title>{{ __('Recent invoices') }}</x-ui.card.title>
<x-ui.card.description>{{ __('Latest billing activity across your workspace.') }}</x-ui.card.description>
</div>
<x-ui.button variant="outline" size="sm">{{ __('View all') }}</x-ui.button>
</div>
</x-ui.card.header>
<x-ui.card.content>
<x-ui.table>
<x-ui.table.header>
<x-ui.table.row>
<x-ui.table.head>{{ __('Invoice') }}</x-ui.table.head>
<x-ui.table.head>{{ __('Customer') }}</x-ui.table.head>
<x-ui.table.head>{{ __('Status') }}</x-ui.table.head>
<x-ui.table.head class="text-end">{{ __('Amount') }}</x-ui.table.head>
</x-ui.table.row>
</x-ui.table.header>
<x-ui.table.body>
@foreach ($invoices as $invoice)
<x-ui.table.row>
<x-ui.table.cell class="font-medium tabular-nums">{{ $invoice['id'] }}</x-ui.table.cell>
<x-ui.table.cell>
<span class="flex items-center gap-2">
<x-ui.avatar size="sm" :fallback="$invoice['initials']" :alt="$invoice['customer']" />
<span>{{ $invoice['customer'] }}</span>
</span>
</x-ui.table.cell>
<x-ui.table.cell>
<x-ui.badge :variant="$invoice['tone']">{{ __($invoice['status']) }}</x-ui.badge>
</x-ui.table.cell>
<x-ui.table.cell class="text-end tabular-nums">{{ $invoice['amount'] }}</x-ui.table.cell>
</x-ui.table.row>
@endforeach
</x-ui.table.body>
</x-ui.table>
</x-ui.card.content>
</x-ui.card>
</div>
</main>
Ownership & lifecycle
Owner, release state, review evidence and adoption for this item.
- Owner
- Platform UI (@JoshJML)
- Current version
-
1.2.2 - Status
- Stable
- License
-
open - Deprecation
- Not deprecated
- Contract
-
v1 - Foundation
-
≥ 1.0.0