Skip to content
Brok UI

Loading…

No results

Map Blocks

Open source

Interactive MapLibre maps — analytics overview, logistics network, geographic heatmap and live delivery tracking.

Preview

resources/views/blocks/maps-logistics.blade.php Blade
@props([
    'eyebrow' => 'Operations',
    'heading' => 'Logistics network',
    'subheading' => 'Real-time view of distribution hubs and freight lanes across the continental US.',
    // Primary fulfilment hub. Lanes fan out from here to every other hub.
    'hub' => ['name' => 'Dallas HQ', 'lng' => -96.797, 'lat' => 32.777, 'throughput' => '4.2k pkg/hr'],
    // Distribution hubs. status: on-time | delayed drives lane + badge colour.
    'hubs' => [
        ['name' => 'Los Angeles', 'lng' => -118.244, 'lat' => 34.052, 'status' => 'on-time', 'throughput' => '3.1k pkg/hr'],
        ['name' => 'Seattle', 'lng' => -122.332, 'lat' => 47.606, 'status' => 'on-time', 'throughput' => '1.4k pkg/hr'],
        ['name' => 'Chicago', 'lng' => -87.630, 'lat' => 41.878, 'status' => 'delayed', 'throughput' => '2.8k pkg/hr'],
        ['name' => 'Atlanta', 'lng' => -84.388, 'lat' => 33.749, 'status' => 'on-time', 'throughput' => '2.2k pkg/hr'],
        ['name' => 'New York', 'lng' => -74.006, 'lat' => 40.713, 'status' => 'delayed', 'throughput' => '3.6k pkg/hr'],
    ],
    'stats' => [
        ['label' => 'Active shipments', 'value' => '12,840'],
        ['label' => 'On-time rate', 'value' => '96.3%'],
        ['label' => 'Hubs online', 'value' => '6 / 6'],
    ],
])

<x-ui.section space="xl" {{ $attributes }}>
    <x-ui.container gutter="sm">
        <div class="max-w-2xl">
            @if ($eyebrow)
                <p class="text-sm font-medium uppercase tracking-wide text-primary">{{ __($eyebrow) }}</p>
            @endif
            <h2 class="mt-4 text-3xl font-bold tracking-tight sm:text-4xl">{{ __($heading) }}</h2>
            <p class="mt-4 text-sm text-muted-foreground">{{ __($subheading) }}</p>
        </div>

        <x-ui.card class="mt-10 overflow-hidden">
            <div class="grid gap-px bg-border lg:grid-cols-3">
                {{-- Map: spans two columns on large screens, full width on mobile. --}}
                <div class="bg-card lg:col-span-2">
                    <x-ui.map
                        :center="[-96, 38]"
                        :zoom="3.4"
                        :min-zoom="2.5"
                        :max-zoom="7"
                        projection="mercator"
                        height="460px"
                        :label="__('US logistics hub map')"
                        class="rounded-none border-0"
                    >
                        <x-ui.map.controls position="top-right" show-zoom />

                        {{-- Freight lanes: HQ → each hub, coloured by lane status. --}}
                        @foreach ($hubs as $hub_lane)
                            <x-ui.map.arc
                                :from="[$hub['lng'], $hub['lat']]"
                                :to="[$hub_lane['lng'], $hub_lane['lat']]"
                                :color="$hub_lane['status'] === 'delayed' ? 'warning' : 'success'"
                                :width="2"
                                :curve="0.3"
                                :dashed="$hub_lane['status'] === 'delayed'"
                            />
                        @endforeach

                        {{-- Primary HQ hub. --}}
                        <x-ui.map.marker :lng="$hub['lng']" :lat="$hub['lat']" color="primary" pulse :label="__($hub['name'])">
                            <x-slot:popup>
                                <p class="text-sm font-semibold text-foreground">{{ __($hub['name']) }}</p>
                                <p class="text-sm text-muted-foreground">{{ __('Primary hub') }}, {{ $hub['throughput'] }}</p>
                            </x-slot:popup>
                        </x-ui.map.marker>

                        {{-- Distribution hubs. --}}
                        @foreach ($hubs as $hub_pin)
                            <x-ui.map.marker
                                :lng="$hub_pin['lng']"
                                :lat="$hub_pin['lat']"
                                :color="$hub_pin['status'] === 'delayed' ? 'warning' : 'success'"
                                :label="__($hub_pin['name'])"
                            >
                                <x-slot:popup>
                                    <p class="text-sm font-semibold text-foreground">{{ __($hub_pin['name']) }}</p>
                                    <p class="text-sm text-muted-foreground">{{ $hub_pin['throughput'] }}</p>
                                </x-slot:popup>
                            </x-ui.map.marker>
                        @endforeach
                    </x-ui.map>
                </div>

                {{-- Sidebar: network stats + active lanes. --}}
                <aside class="bg-card p-6">
                    <h3 class="text-sm font-semibold uppercase tracking-wide text-muted-foreground">{{ __('Network stats') }}</h3>

                    <dl class="mt-4 grid grid-cols-3 gap-4 lg:grid-cols-1">
                        @foreach ($stats as $stat)
                            <div>
                                <dt class="text-sm text-muted-foreground">{{ __($stat['label']) }}</dt>
                                <dd class="mt-2 text-2xl font-bold tracking-tight">{{ $stat['value'] }}</dd>
                            </div>
                        @endforeach
                    </dl>

                    <x-ui.separator class="my-6" />

                    <h3 class="text-sm font-semibold uppercase tracking-wide text-muted-foreground">{{ __('Active lanes') }}</h3>

                    <ul class="mt-4 space-y-4">
                        @foreach ($hubs as $lane)
                            <li class="flex items-center justify-between gap-4">
                                <span class="flex min-w-0 items-center gap-2 text-sm">
                                    <span class="truncate font-medium">{{ __($hub['name']) }}</span>
                                    <svg class="h-4 w-4 flex-none text-muted-foreground rtl:-scale-x-100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                                        <path d="M5 12h14" />
                                        <path d="m12 5 7 7-7 7" />
                                    </svg>
                                    <span class="truncate text-muted-foreground">{{ __($lane['name']) }}</span>
                                </span>
                                @if ($lane['status'] === 'delayed')
                                    <x-ui.badge variant="warning">{{ __('Delayed') }}</x-ui.badge>
                                @else
                                    <x-ui.badge variant="success">{{ __('On time') }}</x-ui.badge>
                                @endif
                            </li>
                        @endforeach
                    </ul>
                </aside>
            </div>
        </x-ui.card>
    </x-ui.container>
</x-ui.section>

Installation

terminal
php artisan ui:add blocks/maps-logistics

Installs these dependencies automatically:

Registry contract

Install confidence

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

Registry dependencies

badge card container map section separator

Package dependencies

composer: jml/brok:^0.2

npm: maplibre-gl

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.

maps-logistics.md
# Brok UI block: Logistics Network (`maps-logistics`)

US distribution network overview with a live hub map, freight lanes and a network-stats sidebar.

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/maps-logistics
```

## Render it

```blade
<x-blocks.maps-logistics />
```

## Props

- `eyebrow` (string, default `Operations`) — Small label shown above the heading.
- `heading` (string, default `Logistics network`) — Section heading.
- `subheading` (string, default `Real-time view of distribution hubs and freight lanes across the continental US.`) — Supporting copy under the heading.
- `hub` (array, default `['name' => 'Dallas HQ', 'lng' => -96.797, 'lat' => 32.777, 'throughput' => '4.2k pkg/hr']`) — Primary fulfilment hub: name plus [lng, lat] and throughput; lanes fan out from here.
- `hubs` (array, default `[…]`) — Distribution hubs: name, [lng, lat], status (on-time|delayed), and throughput; status drives lane colour, dash style, and badge.
- `stats` (array, default `[…]`) — Rows of {label, value} shown in the network-stats grid.

## Use when

- Presenting a US distribution network with a primary hub, freight lanes to satellite hubs, and on-time/delayed status.
- Pairing the map with a sidebar of network stats and an active-lanes list.

## Avoid when

- Needing a single order's live courier route to a customer; use maps-delivery-tracker for delivery tracking, or maps-analytics for a global analytics globe.

## Rules

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

  • Presenting a US distribution network with a primary hub, freight lanes to satellite hubs, and on-time/delayed status.
  • Pairing the map with a sidebar of network stats and an active-lanes list.

Avoid when

  • Needing a single order's live courier route to a customer; use maps-delivery-tracker for delivery tracking, or maps-analytics for a global analytics globe.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.
Anatomy
section header mercator hub map with freight lanes network stats grid active lanes list

Usage

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

resources/views/welcome.blade.php Blade
<x-blocks.maps-logistics />

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/maps-logistics.blade.php Blade
@props([
    'eyebrow' => 'Operations',
    'heading' => 'Logistics network',
    'subheading' => 'Real-time view of distribution hubs and freight lanes across the continental US.',
    // Primary fulfilment hub. Lanes fan out from here to every other hub.
    'hub' => ['name' => 'Dallas HQ', 'lng' => -96.797, 'lat' => 32.777, 'throughput' => '4.2k pkg/hr'],
    // Distribution hubs. status: on-time | delayed drives lane + badge colour.
    'hubs' => [
        ['name' => 'Los Angeles', 'lng' => -118.244, 'lat' => 34.052, 'status' => 'on-time', 'throughput' => '3.1k pkg/hr'],
        ['name' => 'Seattle', 'lng' => -122.332, 'lat' => 47.606, 'status' => 'on-time', 'throughput' => '1.4k pkg/hr'],
        ['name' => 'Chicago', 'lng' => -87.630, 'lat' => 41.878, 'status' => 'delayed', 'throughput' => '2.8k pkg/hr'],
        ['name' => 'Atlanta', 'lng' => -84.388, 'lat' => 33.749, 'status' => 'on-time', 'throughput' => '2.2k pkg/hr'],
        ['name' => 'New York', 'lng' => -74.006, 'lat' => 40.713, 'status' => 'delayed', 'throughput' => '3.6k pkg/hr'],
    ],
    'stats' => [
        ['label' => 'Active shipments', 'value' => '12,840'],
        ['label' => 'On-time rate', 'value' => '96.3%'],
        ['label' => 'Hubs online', 'value' => '6 / 6'],
    ],
])

<x-ui.section space="xl" {{ $attributes }}>
    <x-ui.container gutter="sm">
        <div class="max-w-2xl">
            @if ($eyebrow)
                <p class="text-sm font-medium uppercase tracking-wide text-primary">{{ __($eyebrow) }}</p>
            @endif
            <h2 class="mt-4 text-3xl font-bold tracking-tight sm:text-4xl">{{ __($heading) }}</h2>
            <p class="mt-4 text-sm text-muted-foreground">{{ __($subheading) }}</p>
        </div>

        <x-ui.card class="mt-10 overflow-hidden">
            <div class="grid gap-px bg-border lg:grid-cols-3">
                {{-- Map: spans two columns on large screens, full width on mobile. --}}
                <div class="bg-card lg:col-span-2">
                    <x-ui.map
                        :center="[-96, 38]"
                        :zoom="3.4"
                        :min-zoom="2.5"
                        :max-zoom="7"
                        projection="mercator"
                        height="460px"
                        :label="__('US logistics hub map')"
                        class="rounded-none border-0"
                    >
                        <x-ui.map.controls position="top-right" show-zoom />

                        {{-- Freight lanes: HQ → each hub, coloured by lane status. --}}
                        @foreach ($hubs as $hub_lane)
                            <x-ui.map.arc
                                :from="[$hub['lng'], $hub['lat']]"
                                :to="[$hub_lane['lng'], $hub_lane['lat']]"
                                :color="$hub_lane['status'] === 'delayed' ? 'warning' : 'success'"
                                :width="2"
                                :curve="0.3"
                                :dashed="$hub_lane['status'] === 'delayed'"
                            />
                        @endforeach

                        {{-- Primary HQ hub. --}}
                        <x-ui.map.marker :lng="$hub['lng']" :lat="$hub['lat']" color="primary" pulse :label="__($hub['name'])">
                            <x-slot:popup>
                                <p class="text-sm font-semibold text-foreground">{{ __($hub['name']) }}</p>
                                <p class="text-sm text-muted-foreground">{{ __('Primary hub') }}, {{ $hub['throughput'] }}</p>
                            </x-slot:popup>
                        </x-ui.map.marker>

                        {{-- Distribution hubs. --}}
                        @foreach ($hubs as $hub_pin)
                            <x-ui.map.marker
                                :lng="$hub_pin['lng']"
                                :lat="$hub_pin['lat']"
                                :color="$hub_pin['status'] === 'delayed' ? 'warning' : 'success'"
                                :label="__($hub_pin['name'])"
                            >
                                <x-slot:popup>
                                    <p class="text-sm font-semibold text-foreground">{{ __($hub_pin['name']) }}</p>
                                    <p class="text-sm text-muted-foreground">{{ $hub_pin['throughput'] }}</p>
                                </x-slot:popup>
                            </x-ui.map.marker>
                        @endforeach
                    </x-ui.map>
                </div>

                {{-- Sidebar: network stats + active lanes. --}}
                <aside class="bg-card p-6">
                    <h3 class="text-sm font-semibold uppercase tracking-wide text-muted-foreground">{{ __('Network stats') }}</h3>

                    <dl class="mt-4 grid grid-cols-3 gap-4 lg:grid-cols-1">
                        @foreach ($stats as $stat)
                            <div>
                                <dt class="text-sm text-muted-foreground">{{ __($stat['label']) }}</dt>
                                <dd class="mt-2 text-2xl font-bold tracking-tight">{{ $stat['value'] }}</dd>
                            </div>
                        @endforeach
                    </dl>

                    <x-ui.separator class="my-6" />

                    <h3 class="text-sm font-semibold uppercase tracking-wide text-muted-foreground">{{ __('Active lanes') }}</h3>

                    <ul class="mt-4 space-y-4">
                        @foreach ($hubs as $lane)
                            <li class="flex items-center justify-between gap-4">
                                <span class="flex min-w-0 items-center gap-2 text-sm">
                                    <span class="truncate font-medium">{{ __($hub['name']) }}</span>
                                    <svg class="h-4 w-4 flex-none text-muted-foreground rtl:-scale-x-100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                                        <path d="M5 12h14" />
                                        <path d="m12 5 7 7-7 7" />
                                    </svg>
                                    <span class="truncate text-muted-foreground">{{ __($lane['name']) }}</span>
                                </span>
                                @if ($lane['status'] === 'delayed')
                                    <x-ui.badge variant="warning">{{ __('Delayed') }}</x-ui.badge>
                                @else
                                    <x-ui.badge variant="success">{{ __('On time') }}</x-ui.badge>
                                @endif
                            </li>
                        @endforeach
                    </ul>
                </aside>
            </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.5
Status
Stable
License
open
Deprecation
Not deprecated
Contract
v1
Foundation
≥ 1.0.0