Liveblog Preview
Live Blog Preview Widget
The Arena Live Blog Preview widget is a compact, real-time teaser for a live blog. It shows an optional LIVE tag, a headline, the latest posts (title and "time ago") and a footer link, all linking to the full live blog coverage page.
Place it on article pages, home pages or section fronts to drive readers to a live blog. New posts appear in real time with a short arrival animation, without reloading the page.
The widget is embedded with a <div> and the Arena Universal Snippet. What is shown (headline, number of posts, layout, footer, ...) is configured in the Arena dashboard and resolved from a single preview id. The snippet controls identity and a few presentation overrides (theme and accent color).
Quick Start
<script src="https://fast.arena.im/script.js?siteId=672a2155d728bca5e79986e3" async></script>
<div class="arena-lb-preview"
data-theme="dark"
data-site-slug="arena"
data-liveblog-preview-id="cpZ8CEX8MBAd101MK3FM"></div>The minimal embed needs only the script and the preview id:
<script src="https://fast.arena.im/script.js?siteId=[YOUR-SITE-ID]" async></script>
<div class="arena-lb-preview"
data-liveblog-preview-id="[YOUR-PREVIEW-ID]"></div>[YOUR-PREVIEW-ID] identifies a Live Blog Preview created in the Arena dashboard. It is not the live blog id.
How It Works
- The page loads the Arena Universal Snippet (
script.js) with yoursiteId. - The snippet looks for elements with the class
arena-lb-previewand loads the widget when it finds one. - The widget renders inside the div. Its UI is isolated from the page, so your page CSS does not affect it (and it does not leak into your page).
You can place several .arena-lb-preview divs on the same page; each one works independently.
Parameters Reference
Script parameters (query string of script.js)
script.js)siteId (string)
siteId (string)Required — Your Arena site id. The kebab-case name site-id is also accepted.
https://fast.arena.im/script.js?siteId=672a2155d728bca5e79986e3
Div attributes (<div class="arena-lb-preview">)
<div class="arena-lb-preview">)| Attribute | Required | Values | Default |
|---|---|---|---|
data-liveblog-preview-id | Yes | Preview id string | — |
data-theme | No | light, dark, inherit, system | The widget will use the value defined on the dashboard. |
data-customized-color | No | Any CSS color (#0a7cff, rgb(...)) | Dashboard accent color |
data-site-slug | No | Site slug | — |
data-site-id | No | Site id | Value from the snippet siteId |
data-liveblog-preview-id (string)
data-liveblog-preview-id (string)Required — The id of the Live Blog Preview created in the Arena dashboard. The widget uses it to find the live blog and its display settings. Use the value exactly as shown in the dashboard.
If the attribute is missing, the div shows Live Blog preview widget is missing liveblog-preview-id. and nothing else is rendered.
data-theme (string)
data-theme (string)Optional — Forces the widget theme on this embed. See Theming for details, including an important side effect on colors.
- Accepted values:
light,dark,inherit,system. - Any other value is ignored, as if the attribute was not set.
data-customized-color (string)
data-customized-color (string)Optional — Overrides the accent color (LIVE tag and its pulsing dot, timeline line and dots) with a CSS color.
<div class="arena-lb-preview"
data-customized-color="#0a7cff"
data-liveblog-preview-id="[YOUR-PREVIEW-ID]"></div>Only applies when
data-themeis NOT set. When a theme is forced withdata-theme, the widget uses a fixed palette and this attribute is ignored. See Theming.
data-site-slug (string)
data-site-slug (string)Optional — Your site slug. Kept for consistency with other Arena widgets; the widget does not need it to render.
data-site-id (string)
data-site-id (string)Optional (legacy fallback) — Your site id. If the Universal Snippet provides siteId, that value takes priority. The widget does not need it to render.
Theming
The widget background is always transparent; your page owns the surface. The theme changes the text colors (and the accent palette, see below).
Theme values
data-theme | Text color | Notes |
|---|---|---|
light | Dark text | For light page backgrounds |
dark | Light text | For dark page backgrounds |
inherit | Same as the surrounding text color of your page | Secondary text is a softer version of it |
system | Light, or dark when the visitor's device is in dark mode | Follows the visitor's OS setting |
Theme precedence
The widget resolves the theme in this order:
data-themeon the div (if valid)- Theme from the dashboard configuration (
light,darkorinherit) - Host page theme: when
data-themeis not set, the widget follows thedata-themeattribute of your page's<html>element (dark→ dark, anything else → light) and updates live when it changes (for example, a dark-mode toggle).
Accent colors: forced theme vs. configured theme
| Situation | Accent color |
|---|---|
data-theme not set | data-customized-color, else the accent color set in the dashboard, else the default red |
data-theme set (light, dark, inherit or system) | Fixed palette below. data-customized-color and the dashboard accent are ignored |
Fixed palette used when the theme is forced:
| Mode | Accent (LIVE tag) | Timeline line and dots | Secondary text |
|---|---|---|---|
| Light | #a00000 | #c23b00 | #666666 |
Dark (and system on a dark device) | #ff1a1a | #fa6400 | #949494 |
So the example (data-theme="dark") renders with the fixed dark palette. To use a custom color, remove data-theme and set data-customized-color (or the accent color in the dashboard).
Font
The widget uses the font of your page. To use a different font only for the widget, set the --lb-font CSS variable on the div or any of its ancestors:
<style>
.arena-lb-preview { --lb-font: 'Georgia', serif; }
</style>Options Configured in the Dashboard
These settings are part of the Live Blog Preview configuration in the Arena dashboard and cannot be set from the snippet. They are listed here so you know what to expect.
| Setting | What it controls |
|---|---|
| Live blog | Which live blog the posts come from |
| Headline | Title shown at the top; links to the coverage page |
| Coverage URL | Destination of the headline, footer and post links |
| Number of posts | How many posts are shown, up to 6 |
| Footer | Optional footer link text (hidden when empty) |
| Layout | cards or rail (see below) |
| Theme | Default theme: light, dark or inherit (overridden by data-theme) |
| Accent color | Default accent color (overridden by data-customized-color) |
| Show LIVE tag | Shows the pulsing LIVE label |
| Show header | Shows the headline |
| Show timestamps | Shows the "time ago" under each post title |
Layouts
cards: responsive. When the space available to the widget is wide enough to fit the posts side by side, they are laid out in a horizontal row over a timeline; otherwise they are stacked vertically. It adapts to the width of the container the widget is placed in, not to the screen width.rail: always a vertical timeline with slightly larger text.
Behavior
- Real time: new, edited and removed posts show up automatically. If the connection drops, the widget reconnects and refreshes the list by itself.
- Which posts: only posts marked for preview, newest first. Posts without a title are not shown.
- Arrival animation: a new top post fades in with a pulse on its timeline dot. Animations respect the visitor's reduced-motion setting.
- Empty and error states: if the preview cannot be loaded or has no posts to show, the widget renders nothing (no space is reserved).
- Links: the headline and footer open the coverage URL. Each post opens the coverage URL with
arena_mid=<postId>andarena_post_slug=<slug>query parameters, so the coverage page can go straight to that post. All links open in a new tab. - Language: the headline, footer and post titles are shown as written in the dashboard. The LIVE label and the "time ago" text ("Just now", "12 min ago", "3 hours ago", "2 days ago", then a short date such as "Mar 4") are currently English only.
Host Integration
Click event (arena-lb-preview-click)
arena-lb-preview-click)Every link click dispatches a cancelable arena-lb-preview-click event on document. It lets your page or app (for example a mobile WebView) handle navigation itself.
event.detail:
| Field | Type | Present on |
|---|---|---|
url | string | Always |
postId | string | Post links |
slug | string | Post links |
title | string | Post links |
On post links the event also provides event.getPostData(callback), which loads the full post and calls callback(data, error).
Calling event.preventDefault() stops the browser navigation. If no listener cancels the event, the link opens normally.
<script>
document.addEventListener('arena-lb-preview-click', (event) => {
const { url, postId } = event.detail;
event.preventDefault(); // handle navigation yourself
openInApp(url);
if (event.getPostData) {
event.getPostData((post, error) => {
if (error) return console.log({ error });
console.log({ postId, post });
});
}
});
</script>Single page apps and dynamic content
- Widgets added to the page after it loads are detected and started automatically.
- You can also start them manually by calling
window.initArenaLbPreview(). - Each div is started once. Changing the attributes of a div afterwards has no effect; replace the div with a new one instead.
Examples
Dark theme
<script src="https://fast.arena.im/script.js?siteId=672a2155d728bca5e79986e3" async></script>
<div class="arena-lb-preview"
data-theme="dark"
data-site-slug="my-site-slug"
data-liveblog-preview-id="cpZ8CEX8MBAd101MK3FM"></div>Follow the host page theme
No data-theme: the widget follows <html data-theme="dark"> (live) and uses the dashboard accent color.
<div class="arena-lb-preview"
data-liveblog-preview-id="cpZ8CEX8MBAd101MK3FM"></div>Follow the visitor's device (light/dark mode)
<div class="arena-lb-preview"
data-theme="system"
data-liveblog-preview-id="cpZ8CEX8MBAd101MK3FM"></div>Use the text color of the surrounding container
<div style="background:#0b1f3a; color:#ffffff">
<div class="arena-lb-preview"
data-theme="inherit"
data-liveblog-preview-id="cpZ8CEX8MBAd101MK3FM"></div>
</div>Custom accent color
Do not set data-theme, otherwise the color is ignored.
<div class="arena-lb-preview"
data-customized-color="#0a7cff"
data-liveblog-preview-id="cpZ8CEX8MBAd101MK3FM"></div>Troubleshooting
| Symptom | Likely cause |
|---|---|
| Text "Live Blog preview widget is missing liveblog-preview-id." | data-liveblog-preview-id is missing or empty |
| Nothing renders | The preview id is wrong, the preview has no posts to show yet, or the page could not reach Arena (check your browser's network tab and any content security policy) |
| Widget never appears | The arena-lb-preview class is misspelled, the Universal Snippet did not load, or lb-preview-url is wrong or not URL-encoded |
data-customized-color has no effect | data-theme is set; remove it to use a custom accent color |
| Text is hard to read | The theme does not match your page background; use dark, light, system or inherit, or set data-theme on your page's <html> element |
| Posts do not update live | Real-time connections are blocked (proxy, firewall or content security policy) |
| Changing attributes at runtime does nothing | Each div starts once; replace the div instead |
| A widget added later does not show | Call window.initArenaLbPreview() after inserting the div |
Updated about 1 hour ago