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

  1. The page loads the Arena Universal Snippet (script.js) with your siteId.
  2. The snippet looks for elements with the class arena-lb-preview and loads the widget when it finds one.
  3. 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)

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">)

AttributeRequiredValuesDefault
data-liveblog-preview-idYesPreview id string—
data-themeNolight, dark, inherit, systemThe widget will use the value defined on the dashboard.
data-customized-colorNoAny CSS color (#0a7cff, rgb(...))Dashboard accent color
data-site-slugNoSite slug—
data-site-idNoSite idValue from the snippet siteId

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)

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)

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-theme is NOT set. When a theme is forced with data-theme, the widget uses a fixed palette and this attribute is ignored. See Theming.

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)

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-themeText colorNotes
lightDark textFor light page backgrounds
darkLight textFor dark page backgrounds
inheritSame as the surrounding text color of your pageSecondary text is a softer version of it
systemLight, or dark when the visitor's device is in dark modeFollows the visitor's OS setting

Theme precedence

The widget resolves the theme in this order:

  1. data-theme on the div (if valid)
  2. Theme from the dashboard configuration (light, dark or inherit)
  3. Host page theme: when data-theme is not set, the widget follows the data-theme attribute 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

SituationAccent color
data-theme not setdata-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:

ModeAccent (LIVE tag)Timeline line and dotsSecondary 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.

SettingWhat it controls
Live blogWhich live blog the posts come from
HeadlineTitle shown at the top; links to the coverage page
Coverage URLDestination of the headline, footer and post links
Number of postsHow many posts are shown, up to 6
FooterOptional footer link text (hidden when empty)
Layoutcards or rail (see below)
ThemeDefault theme: light, dark or inherit (overridden by data-theme)
Accent colorDefault accent color (overridden by data-customized-color)
Show LIVE tagShows the pulsing LIVE label
Show headerShows the headline
Show timestampsShows 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> and arena_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)

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:

FieldTypePresent on
urlstringAlways
postIdstringPost links
slugstringPost links
titlestringPost 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

SymptomLikely cause
Text "Live Blog preview widget is missing liveblog-preview-id."data-liveblog-preview-id is missing or empty
Nothing rendersThe 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 appearsThe 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 effectdata-theme is set; remove it to use a custom accent color
Text is hard to readThe 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 liveReal-time connections are blocked (proxy, firewall or content security policy)
Changing attributes at runtime does nothingEach div starts once; replace the div instead
A widget added later does not showCall window.initArenaLbPreview() after inserting the div

Did this page help you?