Tool UI

DocsGalleryassistant-ui
GitHub RepositoryX (Twitter)
Gallery
Get Started
Overview
Quick Start
Response Actions
Receipts
Advanced
UI Guidelines
Contributing
Progress
Plan
Progress Tracker
Input
Option List
Parameter Slider
Preferences Panel
Question Flow
Display
Citation
Link Preview
Item Carousel
Stats Display
Terminal
Weather Widget
Artifacts
Chart
Code Block
Data Table
Message Draft
Social Posts
Confirmation
Approval Card
Order Summary
Media
Image
Image Gallery
Video
Audio
Question Flow

Weather Widget

Display weather conditions and forecasts.

Kansas City, MO

72°F
H 78°L 65°
Now
75°62°
Wed
70°58°
Thu
68°55°
Fri
72°52°
Sat
76°58°
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"    />  );}

Key Features

Weather conditions

13 condition types with matching icons: clear, cloudy, rain, snow, and more

Location display

Show city and region with the current temperature

Temperature units

Support for both Celsius and Fahrenheit display

Multi-day forecast

Display 1-7 day forecasts with high/low temperatures

Source and Install

Copy components/tool-ui/weather-widget and the shared directory into your project.

Prerequisites

pnpm dlx shadcn@latest add card

Download

  • Shared Dependencies (GitHub)
  • Weather Widget (GitHub)

Usage

"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>    );  },});

Props

Prop

Type

CurrentWeather

Prop

Type

ForecastDay

Prop

Type

WeatherCondition

Available condition values with their corresponding icons:

ConditionIconDescription
clearSunClear skies
partly-cloudyCloudSunPartly cloudy
cloudyCloudCloudy
overcastCloudOvercast skies
fogCloudFogFog
drizzleCloudDrizzleLight rain
rainCloudRainRain
heavy-rainCloudRainHeavy rain
thunderstormCloudLightningThunderstorm
snowSnowflakeSnow
sleetCloudHailSleet
hailCloudHailHail
windyWindWindy

Accessibility

  • Forecast list uses proper role="list" and role="listitem" structure
  • Temperature values include screen reader labels with unit names
  • Condition icons are decorative (aria-hidden) with text labels provided