Components
Weather, moon, and tide components for Svelte that inherit your shadcn-svelte theme, base components, and icon library.
Time zones
All cards use an explicit IANA timeZone prop first, then location.timeZone, then the visitor’s browser time zone after hydration (UTC during server rendering). ForecastDashboard forwards its explicit timeZone prop to all three cards. Location coordinates and the provider’s time zone remain separate from the display time zone.
ForecastDashboard
All three components, composed into a dashboard.
Austin, TX
Now
86°
Mostly Sunny
Sample forecast
Galveston Pier 21, TX
Example water level
Rising toward high tide
11:30 AM
Previous low tide
8:28 AM
0.4 ft
Next high tide
2:49 PM
1.5 ft
Sample tides
Austin, TX
Waning Crescent
24% illuminated
- Moon age
- 25 days
- Next full moon
- Sep 26
- Next new moon
- Sep 10
Interactive forecasts
Set interactive to enable navigation inside each card; it defaults to false. Small and simple cards have a subtle View week action in the top-right
corner. Weather and tide cards that already display the forecast list open daily details
directly from each entry. Moon cards offer a weekly phase table.
Day details reuse the original card layout with the selected day's data, preserving its
dimensions without an internal scroll area. Week screens use a compact responsive grid for the
available days. Tide cards show an Upcoming tides summary, while day buttons remain available
from the detailed tide list. Back and Escape return to the previous screen and restore focus.
Weather details use the selected day's conditions for the chosen background.
ForecastDashboard forwards interactive to all three cards.
Weather and tides show supplied periods only, up to seven days; missing days are not filled
in. Moon summaries use astronomical phase calculations anchored to the supplied forecast date.
Set timeZone or location.timeZone to group days in the local calendar.
Installation
Install the required base components.
Install the following dependencies.
Copy and paste the following code into your project.
These files use the default aliases and native icon adapter. Adjust imports to match your project, or use CLI installation to apply your aliases and supported icon mappings automatically. Vue weather glyphs retain their canonical Lucide shapes.
Update the import paths to match your project setup.
Use the example above to compose the component. Unit, size, density, and data props are optional; omitted data uses labeled fixtures.
WeatherForecast
Forecast periods with optional atmospheric backgrounds.
Austin, TX
Now
30°
Mostly Sunny
Going up to 33° today
Sample forecast
Use background on WeatherForecast or ForecastDashboard: "none" (default) keeps the plain card, "realistic" animates a photographic cloud texture. Dithered and gradient backgrounds are temporarily disabled
while their visual design is improved; existing values render a plain card. Realistic backgrounds
respect reduced motion and pause offscreen.
Location-aware skies
Backgrounds use location.latitude, location.longitude, and at to calculate the Sun and Moon with Astronomy Engine. Live cards update every minute;
sample cards use their sample date. Day details use the selected period's start time. Sunrise
and sunset colors follow solar altitude, including nighttime rain, snow, and clouds.
The sky is a fixed panorama: north at both edges, east at one quarter, south in the middle, west at three quarters. Height follows altitude. Sun and Moon discs are enlarged for readability; the Moon shows its calculated illuminated fraction and local tilt, and bodies below the horizon are hidden. Clouds can obscure them. This is an illustrative sky, not a camera-aligned view or a forecast of exact cloud locations.
Pass an explicit at timestamp to preview a moment. The homepage's Sky time picker
finds actual rise, set, and solar transit times; polar locations may have no sunrise or sunset
on the preview date.
Current conditions and temperature outlook
Pass a currentWeather observation separately from forecast periods. The main temperature always shows the observation. If it is unavailable, pass null.
showTemperatureTrend adds the daytime high or tonight's low as a sentence.
Provide currentWeather.highToday to stop the upward sentence after the high has
been reached. showHighLow independently shows high and low arrows using your
project's icon library. Both props default to false and respect unit.
Set an explicit timeZone first; otherwise cards use location.timeZone, then the visitor's browser time zone after hydration. Server
rendering falls back to UTC when neither prop supplies a time zone.
Interactive forecasts
Set interactive to enable navigation inside each card; it defaults to false. Small and simple cards have a subtle View week action in the top-right
corner. Weather and tide cards that already display the forecast list open daily details
directly from each entry. Moon cards offer a weekly phase table.
Day details reuse the original card layout with the selected day's data, preserving its
dimensions without an internal scroll area. Week screens use a compact responsive grid for the
available days. Tide cards show an Upcoming tides summary, while day buttons remain available
from the detailed tide list. Back and Escape return to the previous screen and restore focus.
Weather details use the selected day's conditions for the chosen background.
ForecastDashboard forwards interactive to all three cards.
Weather and tides show supplied periods only, up to seven days; missing days are not filled
in. Moon summaries use astronomical phase calculations anchored to the supplied forecast date.
Set timeZone or location.timeZone to group days in the local calendar.
Installation
Install the required base components.
Install the following dependencies.
Copy and paste the following code into your project.
These files use the default aliases and native icon adapter. Adjust imports to match your project, or use CLI installation to apply your aliases and supported icon mappings automatically. Vue weather glyphs retain their canonical Lucide shapes.
Update the import paths to match your project setup.
Use the example above to compose the component. Unit, size, density, and data props are optional; omitted data uses labeled fixtures.
TideForecast
Nearest coastal tides, with a current reading and interactive prediction curve.
Galveston Pier 21, TX
Example water level
Rising toward high tide
11:30 AM
Previous low tide
8:28 AM
0.1 m
Next high tide
2:49 PM
0.5 m
Sample tides
Interactive forecasts
Set interactive to enable navigation inside each card; it defaults to false. Small and simple cards have a subtle View week action in the top-right
corner. Weather and tide cards that already display the forecast list open daily details
directly from each entry. Moon cards offer a weekly phase table.
Day details reuse the original card layout with the selected day's data, preserving its
dimensions without an internal scroll area. Week screens use a compact responsive grid for the
available days. Tide cards show an Upcoming tides summary, while day buttons remain available
from the detailed tide list. Back and Escape return to the previous screen and restore focus.
Weather details use the selected day's conditions for the chosen background.
ForecastDashboard forwards interactive to all three cards.
Weather and tides show supplied periods only, up to seven days; missing days are not filled
in. Moon summaries use astronomical phase calculations anchored to the supplied forecast date.
Set timeZone or location.timeZone to group days in the local calendar.
Installation
Install the required base components.
Install the following dependencies.
Copy and paste the following code into your project.
These files use the default aliases and native icon adapter. Adjust imports to match your project, or use CLI installation to apply your aliases and supported icon mappings automatically. Vue weather glyphs retain their canonical Lucide shapes.
Update the import paths to match your project setup.
Use the example above to compose the component. Unit, size, density, and data props are optional; omitted data uses labeled fixtures.
MoonForecast
Lunar phase, illumination, and astronomically calculated cycle dates.
Austin, TX
Waning Crescent
24% illuminated
- Moon age
- 25 days
- Next full moon
- Sep 26
- Next new moon
- Sep 11
Interactive forecasts
Set interactive to enable navigation inside each card; it defaults to false. Small and simple cards have a subtle View week action in the top-right
corner. Weather and tide cards that already display the forecast list open daily details
directly from each entry. Moon cards offer a weekly phase table.
Day details reuse the original card layout with the selected day's data, preserving its
dimensions without an internal scroll area. Week screens use a compact responsive grid for the
available days. Tide cards show an Upcoming tides summary, while day buttons remain available
from the detailed tide list. Back and Escape return to the previous screen and restore focus.
Weather details use the selected day's conditions for the chosen background.
ForecastDashboard forwards interactive to all three cards.
Weather and tides show supplied periods only, up to seven days; missing days are not filled
in. Moon summaries use astronomical phase calculations anchored to the supplied forecast date.
Set timeZone or location.timeZone to group days in the local calendar.
Installation
Install the required base components.
Install the following dependencies.
Copy and paste the following code into your project.
These files use the default aliases and native icon adapter. Adjust imports to match your project, or use CLI installation to apply your aliases and supported icon mappings automatically. Vue weather glyphs retain their canonical Lucide shapes.
Update the import paths to match your project setup.
Use the example above to compose the component. Unit, size, density, and data props are optional; omitted data uses labeled fixtures.