Skip to content
Brok UI

Loading…

No results

Dashboard Widget

Open source

System cards — a repository/CI status tile and a storage gauge with a system info table.

Preview

resources/views/blocks/dashboard-widget-system.blade.php Blade
@props([
    'name'  => null,
    'value' => 31,
    'info'  => null,
])

@php
    $name  ??= 'wigggle_db';
    $value   = (int) $value;

    $info ??= [
        ['label' => __('Engine'), 'value' => 'Postgres'],
        ['label' => __('Size'),   'value' => '128 MB'],
        ['label' => __('Tables'), 'value' => '42'],
        ['label' => __('Uptime'), 'value' => '3d 4h'],
        ['label' => __('QPS'),    'value' => '57'],
        ['label' => __('Backup'), 'value' => '02:13 UTC'],
    ];
@endphp

<x-ui.card {{ $attributes->merge(['class' => 'w-full max-w-md p-4']) }}>
    <div class="flex flex-col items-center gap-4 sm:flex-row sm:items-center sm:gap-6">
        {{-- Left: radial gauge --}}
        <div class="flex shrink-0 flex-col items-center gap-2">
            <span class="rounded-md bg-muted px-2 py-2 text-xs font-medium text-foreground">{{ $name }}</span>
            <x-ui.circular-progress :value="$value" :size="120" />
            <span class="text-xs text-muted-foreground">{{ $value }}% {{ __('used') }}</span>
        </div>

        {{-- Right: info table --}}
        <dl class="w-full divide-y divide-border">
            @foreach ($info as $item)
                <div class="flex items-center justify-between gap-4 py-2">
                    <dt class="text-sm text-muted-foreground">{{ $item['label'] }}</dt>
                    <dd class="text-sm font-medium text-foreground text-end">{{ $item['value'] }}</dd>
                </div>
            @endforeach
        </dl>
    </div>
</x-ui.card>

Installation

terminal
php artisan ui:add blocks/dashboard-widget-system

Installs these dependencies automatically:

Registry contract

Install confidence

php artisan ui:add blocks/dashboard-widget-system 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.3
License
open
Stability
stable
Contract
v1
Foundation
≥ 1.0.0
Type Generated target
blade resources/views/blocks/dashboard-widget-system.blade.php

Registry dependencies

card circular-progress

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.

dashboard-widget-system.md
# Brok UI block: Dashboard Widget System (`dashboard-widget-system`)

A system status widget pairing a radial usage gauge with a labelled database info table.

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/dashboard-widget-system
```

## Render it

```blade
<x-blocks.dashboard-widget-system />
```

## Props

- `name` (mixed|null, default `null`)
- `value` (int, default `31`)
- `info` (mixed|null, default `null`)

## Use when

- Showing system or database status with a radial usage gauge paired with a labelled info table (engine, size, uptime, QPS).
- Fitting an admin dashboard with a small, glanceable card rather than a full metrics page.

## Avoid when

- Use dashboard-widget-repo for a repository/deployment status tile instead of a database status widget.

## Rules

- Render the installed block with `<x-blocks.dashboard-widget-system />` 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/dashboard-widget-system
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/dashboard-widget-system.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

  • Showing system or database status with a radial usage gauge paired with a labelled info table (engine, size, uptime, QPS).
  • Fitting an admin dashboard with a small, glanceable card rather than a full metrics page.

Avoid when

  • Use dashboard-widget-repo for a repository/deployment status tile instead of a database status widget.

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.dashboard-widget-system />

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/dashboard-widget-system.blade.php Blade
@props([
    'name'  => null,
    'value' => 31,
    'info'  => null,
])

@php
    $name  ??= 'wigggle_db';
    $value   = (int) $value;

    $info ??= [
        ['label' => __('Engine'), 'value' => 'Postgres'],
        ['label' => __('Size'),   'value' => '128 MB'],
        ['label' => __('Tables'), 'value' => '42'],
        ['label' => __('Uptime'), 'value' => '3d 4h'],
        ['label' => __('QPS'),    'value' => '57'],
        ['label' => __('Backup'), 'value' => '02:13 UTC'],
    ];
@endphp

<x-ui.card {{ $attributes->merge(['class' => 'w-full max-w-md p-4']) }}>
    <div class="flex flex-col items-center gap-4 sm:flex-row sm:items-center sm:gap-6">
        {{-- Left: radial gauge --}}
        <div class="flex shrink-0 flex-col items-center gap-2">
            <span class="rounded-md bg-muted px-2 py-2 text-xs font-medium text-foreground">{{ $name }}</span>
            <x-ui.circular-progress :value="$value" :size="120" />
            <span class="text-xs text-muted-foreground">{{ $value }}% {{ __('used') }}</span>
        </div>

        {{-- Right: info table --}}
        <dl class="w-full divide-y divide-border">
            @foreach ($info as $item)
                <div class="flex items-center justify-between gap-4 py-2">
                    <dt class="text-sm text-muted-foreground">{{ $item['label'] }}</dt>
                    <dd class="text-sm font-medium text-foreground text-end">{{ $item['value'] }}</dd>
                </div>
            @endforeach
        </dl>
    </div>
</x-ui.card>

Ownership & lifecycle

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