Live Sky
The sky over a place right now, seen looking up between buildings: real weather from Open-Meteo (or your fetcher) drawn with WebGL over a ray-traced street (granite, render with blinds, balconies, A Coruña's glazed galleries) lit by the sun's direction, wet in rain and with windows lit at night; clouds from the cloud cover, and rain that falls toward the viewer with depth, slants with the wind and runs down a pane of glass. Drizzle, rain and downpour, snow and fog look different; reduced motion shows stills with a slow crossfade. A place search, a geolocation button, and setLocation, geolocate and refresh for agents.
Example
- Precipitation
- 2.4 mm/h
- Wind
- 22 km/h
Moderate rain, 12°C, sun behind clouds
Installation
lucide-reactUsage
Reach for it where the weather outside is part of the experience: a home screen, a travel or events page, a weather card. Pass a place, or leave location as "geolocate" and let the person share theirs or search. Open-Meteo's free API is for non-commercial use; for a commercial app, createOpenMeteo({ apiKey, forecastUrl, geocodingUrl }) or your own fetchWeather.
API reference
LiveSky
| Prop | Type | Default |
|---|---|---|
labelrequiredThe accessible name of the sky as a whole; agents find it by this. | string | – |
locationA place, or `"geolocate"` (the default) to offer a button that asks the browser where the person is. | SkyLocation | "geolocate" | "geolocate" |
onLocationChangeRuns when the person or an agent picks a place or locates themselves. Nothing is stored unless you store it. | (location: SkyLocation) => void | – |
fetchWeatherFetches the weather; Open-Meteo's free, non-commercial API by default (`createOpenMeteo` for a key or another host). | WeatherFetcher | openMeteo.fetchWeather |
searchPlacesLooks places up by name for the search; Open-Meteo's geocoder by default, `false` for no search. | PlaceSearcher | false | openMeteo.searchPlaces |
onWeatherRuns with each weather answer, the first and every refresh. | (weather: SkyWeather, location: SkyLocation) => void | – |
refreshMsHow often the weather is fetched again while the sky is on screen, in ms. Defaults to 10 minutes. | number | defaultRefreshMs |
simulateShows this weather, time and place instead of fetching. | LiveSkySimulation | – |
photoA photo of the place to show the live sky in instead of the drawn street: its sky is replaced by the weather now, with the sun and moon where they stand through its lens, and the rest is relit; rain and the glass fall over it. Without a `location`, the photo's EXIF position is used, rounded. | LiveSkyPhoto | – |
onPhotoChangeRuns with the photo and its resolved view each time it is calibrated, for the app to keep; nothing is stored here. | (photo: LiveSkyPhoto & LiveSkyPhotoView) => void | – |
glassDrops landing and running down a pane of glass in front of the sky. On by default. | boolean | true |
localeFormats the temperature, rain and wind; the page's language by default. | string | – |
labels | Partial<Omit<LiveSkyLabels, "conditions" | "sun">> & | – |
conditions | Partial<LiveSkyLabels["conditions"]> | – |
sun | Partial<LiveSkyLabels["sun"]> | – |
classNameClasses for the root; a function gets the sky's state. | string | ((state: LiveSkyState) => string | undefined) | – |
onFrameCalled with each frame's drawing time in ms, for measuring. | (milliseconds: number) => void | – |
LiveSkySearch
| Prop | Type | Default |
|---|---|---|
searchPlacesrequired | PlaceSearcher | – |
onPlacerequired | (place: SkyPlace) => void | – |
labelsrequired | LiveSkyLabels | – |
LiveSkyCalibration
| Prop | Type | Default |
|---|---|---|
viewrequired | LiveSkyPhotoView | – |
markingrequired | boolean | – |
labelsrequired | LiveSkyPhotoLabels | – |
onViewrequired | (change: Partial<LiveSkyPhotoView>) => void | – |
onMarkingrequired | (marking: boolean) => void | – |
formatrequired | (value: number) => string | – |
LiveSkyPhotoUpload
| Prop | Type | Default |
|---|---|---|
labelrequiredThe button's text, and its accessible name. | string | – |
onPhotorequiredRuns with the photo, read locally as an object URL, and its GPS position, rounded, when the EXIF has one. | (photo: LiveSkyPhoto, place: SkyLocation | undefined) => void | – |
disabled | boolean | false |
Other exports
liveSkyLabelsliveSkycreateOpenMeteoisValidLocationopenMeteoparseForecastparsePlacesroundCoordinateroundedLocationcreateWeatherFeedkeyOfconditionOfskyConditionssteppedRaindaylightAtmoonPhasemoonPositionradiansPerDegreesunPositioncameraForprojectDirectionprojectPolygonrayThroughskyDirectiontoCameraaddcssColourluminancemixparseHexreadPalettescaleskyPaletteDefaultsbrightnesslightForskyColourAtsmoothstepseededRandomstreetFornoiseSizenoiseTilesampleTilepaintSkytowardcloudAtcloudDeckForpaintCloudsatmosphereForfallsFormaxParticlescreateGlasslightFacadesIntolightPhotoIntofacadeLightingForskylineOfbuildGBufferplaceLengthMplaceStartMattributesbindTextureslinknoiseTextureresizeTargettargettextureuploadblurFragmentfullScreenVertexglowFragmentlightingFragmentcreateSamplefinishessampleSurfacecreateRelightercreateStreetBuildercreateIdleWorkcreateSkyRunnerserveSkyRunnercontext2dcreateSurfacewebglContextcreateHitfloorsOfindexStreetnormalssurfacestraceRaywindowRectbayAthasGalleryloadPhotoLayersphotoCameraphotoLightingForphotoGlowFragmentphotoLightingFragmentliveSkyPhotoLabelscaptureDateuseLiveSkyPhotouseObjectUrlscomposeScenesceneMotionbackdropFragmentbackdropVertexdropFragmentdropVertexfallFragmentfallVertexcreateWebGLRenderercreateCanvasRendererplanRenderercreateSkyEngineuseLiveSkySceneuseSkyTimeuseLiveSkyWeatherGeolocationErroruseLiveSkyGeolocationtype LiveSkyLabelstype LiveSkyPropstype LiveSkySimulationtype LiveSkyStatetype GeolocationAccesstype LiveSkyHandlerstype LiveSkyOptionstype SkySummaryPartstype OpenMeteoOptionstype PlaceSearchertype SkyLocationtype SkyPlacetype SkyWeathertype WeatherFetchertype FeedSettingstype WeatherFeedtype WeatherSnapshottype WeatherStatustype RainKindtype SkyConditionstype SunStatetype WeatherConditiontype Daylighttype MoonPhasetype SkyPositiontype ScreenPointtype SkyCameratype Vec3type Rgbtype SkyPalettetype SkyPaletteKeytype SkyLighttype Balconiestype Buildingtype BuildingStyletype Streettype WindowShapetype NoiseTiletype CloudDecktype Atmospheretype Falltype Framingtype Glasstype GlassDroptype FacadeLightingtype Skylinetype GBuffertype GBufferBuildtype GLtype Programtype Targettype Finishtype Sampletype IdleJobtype EngineModetype FromRunnertype RunnerEventstype RunnerInputtype RunnerViewtype SkyRunnertype ToRunnertype Surfacetype Surface2Dtype Hittype NormalCodetype StreetIndextype SurfaceCodetype LiveSkyPhototype LiveSkyPhotoViewtype PhotoLayerstype PhotoLightingtype LiveSkyPhotoLabelstype LiveSkyPhotoUploadPropstype PhotoStatustype SceneInputtype SceneMotiontype SkyBackgroundtype SkyRenderertype SkyScenetype StreetFacadestype RenderPlantype EngineInputtype ShownPhototype SkyEngineAccessibility
- The scene is decorative and hidden from assistive tech; the readout and a summary sentence ("Moderate rain, 12 °C, sun behind clouds") say what it shows, and the summary is announced politely when it changes.
- The place search is UI SDK's combobox: it waits for typing to pause, announces the number of places found and lists each with its region and country.
- Location is asked for only when the person presses Use my location; when they've blocked it, the button is off and says why.
- Under reduced motion the rain holds still: a new still every few seconds, crossfaded slowly, and no lightning.
- With a photo, the photo is decoration too; Calibrate opens named sliders for its Heading, Field of view and Horizon, and Mark the sun is a toggle.
Agent actions
Agents read the summary as the sky's value and call setLocation (a place name, or a latitude and longitude), geolocate, refresh and, with a photo, calibrate; denied location access, simulated weather or a missing place fails the step with why.
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.