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

1 of 2

resources/views/blocks/dashboard-widget-repo.blade.php Blade
@props([
    'repo'    => null,
    'url'     => null,
    'initials' => null,
    'status'  => null,
    'rows'    => null,
    'href'    => null,
])

@php
    $repo     ??= 'wigggle-ui';
    $url      ??= 'github.com/wigggle-ui/ui';
    $initials ??= 'WU';
    $status   ??= __('Running');
    $href     ??= '#';

    $rows ??= [
        ['icon' => 'git-commit', 'label' => 'chore: nextjs v16'],
        ['icon' => 'git-branch', 'label' => 'prod'],
        ['icon' => 'shield-check', 'label' => __('Firewall Active')],
    ];
@endphp

<x-ui.card {{ $attributes->merge(['class' => 'w-full max-w-[16rem] flex flex-col gap-4 p-4']) }}>
    {{-- Header: avatar + repo name + url, plus status pulse --}}
    <div class="flex items-start justify-between gap-2">
        <div class="flex min-w-0 items-center gap-2">
            <x-ui.avatar size="sm" :fallback="$initials" :alt="$repo" />
            <div class="min-w-0">
                <p class="truncate text-sm font-medium text-foreground">{{ $repo }}</p>
                <p class="truncate text-xs text-muted-foreground">{{ $url }}</p>
            </div>
        </div>

        <div class="flex shrink-0 items-center gap-2">
            <span class="inline-flex size-2 rounded-full bg-success motion-safe:animate-pulse" aria-hidden="true"></span>
            <span class="text-xs text-muted-foreground">{{ $status }}</span>
        </div>
    </div>

    {{-- Status rows --}}
    <div class="flex flex-col gap-2">
        @foreach ($rows as $row)
            <div class="flex items-center gap-2">
                @switch($row['icon'])
                    @case('git-commit')
                        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="size-4 shrink-0 text-muted-foreground" aria-hidden="true">
                            <circle cx="12" cy="12" r="3" />
                            <line x1="3" y1="12" x2="9" y2="12" />
                            <line x1="15" y1="12" x2="21" y2="12" />
                        </svg>
                        @break
                    @case('git-branch')
                        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="size-4 shrink-0 text-muted-foreground" aria-hidden="true">
                            <line x1="6" y1="3" x2="6" y2="15" />
                            <circle cx="18" cy="6" r="3" />
                            <circle cx="6" cy="18" r="3" />
                            <path d="M18 9a9 9 0 0 1-9 9" />
                        </svg>
                        @break
                    @case('shield-check')
                        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="size-4 shrink-0 text-muted-foreground" aria-hidden="true">
                            <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" />
                            <path d="m9 12 2 2 4-4" />
                        </svg>
                        @break
                @endswitch
                <span class="text-sm text-foreground">{{ $row['label'] }}</span>
            </div>
        @endforeach
    </div>

    {{-- Footer --}}
    <div class="mt-2">
        <x-ui.button variant="outline" size="sm" :href="$href" class="w-full">{{ __('Visit') }}</x-ui.button>
    </div>
</x-ui.card>

Installation

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

Installs these dependencies automatically:

Registry contract

Install confidence

php artisan ui:add blocks/dashboard-widget-repo 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-repo.blade.php

Registry dependencies

card avatar button

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-repo.md
# Brok UI block: Dashboard Widget Repo (`dashboard-widget-repo`)

A compact repository status tile with avatar, live running indicator, commit/branch/firewall rows, and a Visit action.

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-repo
```

## Render it

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

## Props

- `repo` (mixed|null, default `null`)
- `url` (mixed|null, default `null`)
- `initials` (mixed|null, default `null`)
- `status` (mixed|null, default `null`)
- `rows` (mixed|null, default `null`)
- `href` (mixed|null, default `null`)

## Use when

- Showing a compact repository status tile with a live-running indicator, recent commit/branch/firewall rows and a Visit action.
- Fitting a dev-tooling dashboard with a small, glanceable card rather than a full data table.

## Avoid when

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

## Rules

- Render the installed block with `<x-blocks.dashboard-widget-repo />` 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-repo
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/dashboard-widget-repo.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 a compact repository status tile with a live-running indicator, recent commit/branch/firewall rows and a Visit action.
  • Fitting a dev-tooling dashboard with a small, glanceable card rather than a full data table.

Avoid when

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

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-repo />

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-repo.blade.php Blade
@props([
    'repo'    => null,
    'url'     => null,
    'initials' => null,
    'status'  => null,
    'rows'    => null,
    'href'    => null,
])

@php
    $repo     ??= 'wigggle-ui';
    $url      ??= 'github.com/wigggle-ui/ui';
    $initials ??= 'WU';
    $status   ??= __('Running');
    $href     ??= '#';

    $rows ??= [
        ['icon' => 'git-commit', 'label' => 'chore: nextjs v16'],
        ['icon' => 'git-branch', 'label' => 'prod'],
        ['icon' => 'shield-check', 'label' => __('Firewall Active')],
    ];
@endphp

<x-ui.card {{ $attributes->merge(['class' => 'w-full max-w-[16rem] flex flex-col gap-4 p-4']) }}>
    {{-- Header: avatar + repo name + url, plus status pulse --}}
    <div class="flex items-start justify-between gap-2">
        <div class="flex min-w-0 items-center gap-2">
            <x-ui.avatar size="sm" :fallback="$initials" :alt="$repo" />
            <div class="min-w-0">
                <p class="truncate text-sm font-medium text-foreground">{{ $repo }}</p>
                <p class="truncate text-xs text-muted-foreground">{{ $url }}</p>
            </div>
        </div>

        <div class="flex shrink-0 items-center gap-2">
            <span class="inline-flex size-2 rounded-full bg-success motion-safe:animate-pulse" aria-hidden="true"></span>
            <span class="text-xs text-muted-foreground">{{ $status }}</span>
        </div>
    </div>

    {{-- Status rows --}}
    <div class="flex flex-col gap-2">
        @foreach ($rows as $row)
            <div class="flex items-center gap-2">
                @switch($row['icon'])
                    @case('git-commit')
                        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="size-4 shrink-0 text-muted-foreground" aria-hidden="true">
                            <circle cx="12" cy="12" r="3" />
                            <line x1="3" y1="12" x2="9" y2="12" />
                            <line x1="15" y1="12" x2="21" y2="12" />
                        </svg>
                        @break
                    @case('git-branch')
                        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="size-4 shrink-0 text-muted-foreground" aria-hidden="true">
                            <line x1="6" y1="3" x2="6" y2="15" />
                            <circle cx="18" cy="6" r="3" />
                            <circle cx="6" cy="18" r="3" />
                            <path d="M18 9a9 9 0 0 1-9 9" />
                        </svg>
                        @break
                    @case('shield-check')
                        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="size-4 shrink-0 text-muted-foreground" aria-hidden="true">
                            <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" />
                            <path d="m9 12 2 2 4-4" />
                        </svg>
                        @break
                @endswitch
                <span class="text-sm text-foreground">{{ $row['label'] }}</span>
            </div>
        @endforeach
    </div>

    {{-- Footer --}}
    <div class="mt-2">
        <x-ui.button variant="outline" size="sm" :href="$href" class="w-full">{{ __('Visit') }}</x-ui.button>
    </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