Embeddable Widget
Add real-time US flag half-staff status to your website with a single line of code.
Basic Usage
Paste this snippet wherever you want the widget to appear:
<script src="https://itshalfstaffbecause.com/widget.js" async></script>
Options
Customize the widget with data- attributes:
| Attribute | Description | Example |
|---|---|---|
| data-state | Show status for a specific state (2-letter abbreviation) | data-state="CA" |
| data-theme | Color theme: light (default) or dark | data-theme="dark" |
| data-compact | Compact mode: shows only the primary reason | data-compact |
Examples
National status (default)
<script src="https://itshalfstaffbecause.com/widget.js" async></script>
Single state (Texas)
<script src="https://itshalfstaffbecause.com/widget.js" data-state="TX" async></script>
Dark theme, compact
<script src="https://itshalfstaffbecause.com/widget.js" data-theme="dark" data-compact async></script>
API
Prefer to build your own UI? Use the JSON API directly:
GET https://itshalfstaffbecause.com/api/v1/widget GET https://itshalfstaffbecause.com/api/v1/widget?state=CA
Returns JSON with is_half_staff, half_staff_count, and orders array. CORS-enabled for browser requests. Cached for 5 minutes.