Skip to content
Generative UIWeather cardMenu

Weather card

The reference generative widget: current conditions, an hourly strip and a week of ranges on one shared scale, like a thermometer laid flat.

Now, the next eight hours and a week of ranges on one shared scale.

Installation

$ pnpm dlx shadcn@latest add https://chatcn.dev/r/weather-card.json

Usage

tsx
import { WeatherCard } from "@/components/ui/chatcn/weather-card"

const part = message.parts.find((p) => p.type === "tool-get_weather")
<WeatherCard {...part?.output} loading={part?.state !== "output-available"} />

Examples

Loading and error

A skeleton in the final shape and a failed lookup with retry.

Props

PropTypeNotes
location, updatedstring
temp, high, low, feelsLikenumberDegrees in unit
unit"C" | "F"Default C
conditionWeatherConditionclear, clear-night, partly-cloudy, cloudy, rain, storm, snow, wind, fog
humidity, windnumber, string
hourly{ time, temp, condition?, precip? }[]Precipitation shows from 30%
daily{ day, high, low, condition?, precip? }[]
loading, streaming, error, onRetry

Accessibility

  • The temperature reads in words (21 degrees Celsius). Each day reads its condition, low and high; the range bars are hidden from screen readers.

Motion

  • The condition icon swaps with a 150 ms blur crossfade when it changes. Nothing else moves.