Kansas City, MO
72
H 78°L 65°
import { WeatherWidget } from "@/components/tool-ui/weather-widget";export function Example() { return ( <WeatherWidget id="weather-widget-example" location="Kansas City, MO" current={{ temp: 72, tempMin: 65, tempMax: 78, condition: "thunderstorm", }} forecast={[ { day: "Tue", tempMin: 62, tempMax: 75, condition: "heavy-rain" }, { day: "Wed", tempMin: 58, tempMax: 70, condition: "rain" }, { day: "Thu", tempMin: 55, tempMax: 68, condition: "cloudy" }, { day: "Fri", tempMin: 52, tempMax: 72, condition: "partly-cloudy" }, { day: "Sat", tempMin: 58, tempMax: 76, condition: "clear" }, ]} unit="fahrenheit" updatedAt="2026-01-28T22:00:00Z" /> );}13 condition types with matching icons: clear, cloudy, rain, snow, and more
Show city and region with the current temperature
Support for both Celsius and Fahrenheit display
Display 1-7 day forecasts with high/low temperatures
Copy components/tool-ui/weather-widget and the shared directory into your project.
pnpm dlx shadcn@latest add card"use client";import { makeAssistantTool } from "@assistant-ui/react";import { WeatherWidget, WeatherWidgetErrorBoundary, parseSerializableWeatherWidget, SerializableWeatherWidgetSchema, type SerializableWeatherWidget,} from "@/components/tool-ui/weather-widget";export const WeatherWidgetTool = makeAssistantTool<SerializableWeatherWidget>({ toolName: "get_weather", description: "Display current weather and forecast for a location", parameters: SerializableWeatherWidgetSchema, render: ({ args, toolCallId }) => { if (!args.location || !args.current || !args.forecast) return null; const data = parseSerializableWeatherWidget({ ...args, id: (args as any)?.id ?? `weather-${toolCallId}`, }); return ( <WeatherWidgetErrorBoundary> <WeatherWidget {...data} /> </WeatherWidgetErrorBoundary> ); },});Prop
Type
Prop
Type
Prop
Type
Available condition values with their corresponding icons:
| Condition | Icon | Description |
|---|---|---|
clear | Sun | Clear skies |
partly-cloudy | CloudSun | Partly cloudy |
cloudy | Cloud | Cloudy |
overcast | Cloud | Overcast skies |
fog | CloudFog | Fog |
drizzle | CloudDrizzle | Light rain |
rain | CloudRain | Rain |
heavy-rain | CloudRain | Heavy rain |
thunderstorm | CloudLightning | Thunderstorm |
snow | Snowflake | Snow |
sleet | CloudHail | Sleet |
hail | CloudHail | Hail |
windy | Wind | Windy |
role="list" and role="listitem" structurearia-hidden) with text labels provided