Widget Gallery
Embed live weather forecasts on your site with a single script tag.
Configure
Powered by activeweather
Need more control? View API docs for custom integrations
Integration Guides
WordPress
Add the widget using a Custom HTML block:
- Open the page or post editor
- Add a Custom HTML block
- Paste the embed code from the configurator above
- Preview or publish
For site-wide placement, paste the code into a Custom HTML widget in Appearance → Widgets.
Static HTML
Add the <script> tag anywhere in your <body>:
<body>
<!-- your content -->
<script src="https://cdn.activeweather.com/widgets/forecast.js"
data-key="YOUR_API_KEY"
data-zip="Seattle, WA"></script>
</body> The widget renders itself where the script tag is placed.
React / Next.js
Load the widget in a useEffect:
import { useEffect, useRef } from 'react';
function ForecastWidget({ city }) {
const ref = useRef(null);
useEffect(() => {
const script = document.createElement('script');
script.src = 'https://cdn.activeweather.com/widgets/forecast.js';
script.dataset.key = 'YOUR_API_KEY';
script.dataset.zip = city;
ref.current?.appendChild(script);
return () => script.remove();
}, [city]);
return <div ref={ref} />;
} Substack
Substack supports embed blocks with limitations:
- In the post editor, add an Embed block
- Paste the embed code
- Preview to confirm it renders
Limitations: Substack strips some attributes on publish. If the widget doesn't render, use an iframe wrapper instead:
<iframe
src="https://activeweather.com/embed/forecast?zip=Seattle,%20WA"
width="100%" height="300"
frameborder="0"></iframe> Why activeweather widgets?
Under 20 KB gzipped. No frameworks, no dependencies.
Light, dark, or auto-detect from user preferences.
Shadow DOM keeps widget styles from leaking into your page.
Semantic markup and screen-reader-friendly labels.
Need more control? See the API documentation for custom integrations.