Weather Widget
Compact weather cards — current conditions, minimalist, extended with high/low, metric tiles, hourly strip, four-day forecast and a wide metrics dashboard.
Preview
@props([
'location' => 'San Francisco',
'temperature' => 72,
'condition' => 'clear',
])
<x-ui.card class="w-full max-w-[15rem] aspect-square flex flex-col p-6">
<div class="flex items-center justify-between gap-2">
<p class="text-base font-semibold text-foreground">{{ __($location) }}</p>
<x-ui.weather-icon :condition="$condition" size="sm" class="size-5 shrink-0 text-muted-foreground" />
</div>
<div class="flex flex-1 items-center justify-center">
<p class="text-5xl font-semibold tabular-nums text-foreground">{{ $temperature }}°</p>
</div>
</x-ui.card>
Installation
php artisan ui:add blocks/weather-widget-minimal
Registry contract
Install confidence
php artisan ui:add blocks/weather-widget-minimal
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.1.2
- License
- open
- Stability
- stable
- Contract
- v1
- Foundation
- ≥ 1.0.0
| Type | Generated target |
|---|---|
| blade | resources/views/blocks/weather-widget-minimal.blade.php |
Registry dependencies
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.
# Brok UI block: Weather Widget Minimal (`weather-widget-minimal`)
A minimal square weather widget with a city and small icon header above a large centered temperature.
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/weather-widget-minimal
```
## Render it
```blade
<x-blocks.weather-widget-minimal />
```
## Props
- `location` (string, default `San Francisco`) — Location name shown in the header row.
- `temperature` (int, default `72`) — Current temperature value.
- `condition` (string, default `clear`) — Weather condition key that selects the icon.
## Use when
- Showing weather in the smallest possible footprint: a city name, small icon and large temperature.
- Fitting an extremely tight space, such as a sidebar tile.
## Avoid when
- Needing more detail like feels-like or forecast; use weather-widget-metrics instead.
## Rules
- Render the installed block with `<x-blocks.weather-widget-minimal />` 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/weather-widget-minimal
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/weather-widget-minimal.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 weather in the smallest possible footprint: a city name, small icon and large temperature.
- Fitting an extremely tight space, such as a sidebar tile.
Avoid when
- Needing more detail like feels-like or forecast; use weather-widget-metrics instead.
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:
<x-blocks.weather-widget-minimal />
Built from primitives
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.
@props([
'location' => 'San Francisco',
'temperature' => 72,
'condition' => 'clear',
])
<x-ui.card class="w-full max-w-[15rem] aspect-square flex flex-col p-6">
<div class="flex items-center justify-between gap-2">
<p class="text-base font-semibold text-foreground">{{ __($location) }}</p>
<x-ui.weather-icon :condition="$condition" size="sm" class="size-5 shrink-0 text-muted-foreground" />
</div>
<div class="flex flex-1 items-center justify-center">
<p class="text-5xl font-semibold tabular-nums text-foreground">{{ $temperature }}°</p>
</div>
</x-ui.card>
Ownership & lifecycle
Owner, release state, review evidence and adoption for this item.
- Owner
- Platform UI (@JoshJML)
- Current version
-
1.1.2 - Status
- Stable
- License
-
open - Deprecation
- Not deprecated
- Contract
-
v1 - Foundation
-
≥ 1.0.0