Skip to content
Brok UI

Loading…

No results

Weather Widget

Open source

Compact weather cards — current conditions, minimalist, extended with high/low, metric tiles, hourly strip, four-day forecast and a wide metrics dashboard.

Preview

1 of 7

resources/views/blocks/weather-widget-current.blade.php Blade
@props([
    'location' => 'San Francisco',
    'temperature' => 72,
    'condition' => 'clear',
])

<x-ui.card class="w-full max-w-[15rem] aspect-square flex flex-col items-center justify-center gap-4 p-6 text-center">
    <div class="flex flex-1 flex-col items-center justify-center gap-4">
        <x-ui.weather-icon :condition="$condition" size="xl" class="text-muted-foreground" />
        <p class="text-4xl font-semibold tabular-nums text-foreground">{{ $temperature }}&deg;</p>
    </div>
    <p class="text-lg font-semibold text-foreground">{{ __($location) }}</p>
</x-ui.card>

Installation

terminal
php artisan ui:add blocks/weather-widget-current

Installs these dependencies automatically:

Registry contract

Install confidence

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

Registry dependencies

card weather-icon

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.

weather-widget-current.md
# Brok UI block: Weather Widget Current (`weather-widget-current`)

A square weather widget with a large condition icon, current temperature, and location footer.

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

## Render it

```blade
<x-blocks.weather-widget-current />
```

## Props

- `location` (string, default `San Francisco`) — Location name shown at the foot of the card.
- `temperature` (int, default `72`) — Current temperature value.
- `condition` (string, default `clear`) — Weather condition key that selects the icon.

## Use when

- Showing current weather with a large condition icon and temperature in a compact square card.
- Using it as the simplest weather widget when only the current reading matters.

## Avoid when

- Needing feels-like, high/low or hourly detail; use weather-widget-minimal through weather-widget-dashboard instead.

## Rules

- Render the installed block with `<x-blocks.weather-widget-current />` 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-current
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/weather-widget-current.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 current weather with a large condition icon and temperature in a compact square card.
  • Using it as the simplest weather widget when only the current reading matters.

Avoid when

  • Needing feels-like, high/low or hourly detail; use weather-widget-minimal through weather-widget-dashboard 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:

resources/views/welcome.blade.php Blade
<x-blocks.weather-widget-current />

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/weather-widget-current.blade.php Blade
@props([
    'location' => 'San Francisco',
    'temperature' => 72,
    'condition' => 'clear',
])

<x-ui.card class="w-full max-w-[15rem] aspect-square flex flex-col items-center justify-center gap-4 p-6 text-center">
    <div class="flex flex-1 flex-col items-center justify-center gap-4">
        <x-ui.weather-icon :condition="$condition" size="xl" class="text-muted-foreground" />
        <p class="text-4xl font-semibold tabular-nums text-foreground">{{ $temperature }}&deg;</p>
    </div>
    <p class="text-lg font-semibold text-foreground">{{ __($location) }}</p>
</x-ui.card>

Ownership & lifecycle

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