Magoo Component UI logo Magoo Component UI
← Catalog

Current Weather

current-weather organism experimental

A current-conditions panel with temp, condition, and detail stats.

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

Default

San Francisco, CA

17°

Partly cloudy

H:20° L:12° · Feels like 16°

Humidity
72%
Wind
19 km/h
Pressure
1014 mb
Visibility
14 km
Fahrenheit

Phoenix, AZ

38°

Sunny

H:41° L:27° · Feels like 40°

Humidity
18%
Wind
6 mph
Pressure
1008 mb
Visibility
10 mi
NoSwitcher

London, UK

11°

Light rain

H:13° L:8° · Feels like 9°

Humidity
88%
Wind
24 km/h
Pressure
1002 mb
Visibility
6 km

Props

NameTypeReq
location string ✓
temp_c integer ✓
condition string ✓
icon string
default_unit enum (celsius | fahrenheit)
show_unit_switcher boolean
high_c integer
low_c integer
feels_c integer
stats array

How to use

Pass all temperatures in Celsius (`temp_c`, and optionally `high_c`/`low_c` and `feels_c`); the component's behavior.js renders a °C/°F segmented metric/imperial control and converts the values in place when toggled — no extra wiring needed. Set `default_unit` to `celsius` (default) or `fahrenheit` to choose which system shows first; temperatures are rounded to whole degrees. Wind and visibility convert too. For each such stat pass `metric` (the canonical metric number) and `unit` (`"speed"` for km/h<->mph, `"distance"` for km<->mi), plus `value` set to the default_unit-formatted string (e.g. `{ label: "Wind", value: "19 km/h", metric: 19, unit: "speed" }`). Stats without a `unit` (humidity, pressure) are shown verbatim and never converted. Set `show_unit_switcher: false` to hide the toggle and lock the panel to `default_unit` (the values are still rendered correctly, converting once on load for a Fahrenheit default). When shown, the switcher dispatches a bubbling `current-weather:unitchange` CustomEvent on the component root with `event.detail = { unit }` (`"celsius"` | `"fahrenheit"`), so a page can react (e.g. persist the choice or convert other on-page values). Example: `el.addEventListener('current-weather:unitchange', e => localStorage.setItem('unit', e.detail.unit))`.

Use cases

stathero WCAG AA SEO 45 dir: both ai-generated