Skip to main content

Components

A template is a tree of components. The template field of widget.json holds the root component, and container components hold children. This page lists every component type the player supports.

Common fields​

Every component accepts these fields:

FieldTypeDescription
typestringThe component type. Required.
namestringA name for the component. Used in debugging and as the data-name attribute of the rendered element.
optsobjectType-specific options, described below. Any option value can be a binding.
styleobjectCSS properties in kebab-case, such as "font-size". Values can be bindings. See Styling.
animationsarrayGSAP animations, applied on group, text, image and qr-code components. See Animations.
filterobjectRenders the component only if every listed key path equals the given value. See Conditional rendering.
whenbindingRenders the component only if the binding resolves to a present value. See Conditional rendering.

group and text components also accept $styles, a list of conditional style overrides. See Conditional styles.

The root component can set "fontScale": true to scale em units with the screen size. See Font scaling.

Component types​

TypePurpose
textA single text, with optional auto-fit and scrolling
imageAn image
videoA video
groupA container for other components
paginated-listA list of items shown page by page
scrollerA list of items scrolling continuously
image-carouselA slideshow of images
layoutSeveral playlists shown side by side
qr-codeA QR code

The player throws an error for any other type, and the widget does not render.

text​

Displays text.

OptionTypeDescription
textstring or bindingThe text to display.
autofitobjectSizes the font to fit the component. See below.

A text component fills its parent by default (width and height of 100%). If its style sets flex, only the width defaults to 100% and the height follows the flex layout. If it is absolutely positioned, it sizes to its content. The default line-height is 1em; set a larger value for texts that wrap to several lines.

Text components also accept an editable field that lets users change the text per playlist item. See Editable texts.

Auto-fit​

With autofit, the player measures the text and sets the font size, in em, so that the text fits inside the component. Do not set font-size in the style of an auto-fit text; the player sets it.

AttributeTypeDescription
baseSizenumberPreferred size. Kept if the text fits; otherwise the player shrinks the text.
maxSizenumberLargest size the player may use. Default 10.
minSizenumberSmallest size. If the text does not fit at this size, it scrolls horizontally.

"autofit": {} fills the available space. Without autofit, the text keeps the size set in its style and is never measured, which is cheaper on slow players.

Auto-fit headline

The headline grows or shrinks to fill 80% of the width and half of the height.

Loading preview…

When the fitted size would be smaller than minSize, the player keeps minSize and scrolls the text horizontally in a loop. The scroll takes 0.25 seconds per character after a 1-second pause.

Scrolling notice

A long message that does not fit at the minimum size scrolls horizontally.

Loading preview…

image​

Displays an image as the background of the component.

OptionTypeDescription
urlstring or bindingImage URL. src is accepted as an alias.
fallbackUrlstring or bindingImage shown if url is empty. fallback is accepted as an alias.
size"contain" or "cover"How the image fills the component. Default "contain".
autozoombooleanShortcut for "size": "cover".
durationnumberDisplay time in milliseconds when the widget has no duration option. Default 10000.

The player caches images on the device and displays them from the cache. To show a media file the user picks in the dashboard, bind the URL to a ref option. See Media references.

Image

An image that covers the whole widget.

Loading preview…

video​

Plays a video. The widget lasts as long as the video; if the length is unknown, the player uses 10 seconds.

OptionTypeDescription
urlstring or bindingVideo URL.
size"contain" or "cover"How the video fills the component.
{
"type": "video",
"name": "clip",
"opts": {
"url": { "key": "options.video.files[@target].uri" },
"size": "cover"
},
"style": { "width": "100%", "height": "100%" }
}
caution

Legacy players can decode only a small number of videos at the same time. Use one video per widget and avoid videos inside lists. See Best practices.

group​

A container that renders its children, listed in components, inside a div. Use the group's style to lay out the children, usually with flexbox.

FieldTypeDescription
componentsarrayChild components. Top-level field, not inside opts.
contextbindingOptional. Sets $ for the children, so they can use short $. paths.
opts.limitnumber or bindingOptional. Renders only the first limit visible children.
{
"type": "group",
"name": "agent",
"context": { "key": "data.agent" },
"style": { "display": "flex", "align-items": "center" },
"components": [
{ "type": "image", "name": "photo", "opts": { "url": { "key": "$.photo" }, "size": "cover" }, "style": { "flex": "0 0 auto", "width": "12em", "height": "12em" } },
{ "type": "text", "name": "agent-name", "opts": { "text": { "key": "$.name" } }, "style": { "flex": "1 1 auto", "margin-left": "2em", "font-size": "4em" } }
]
}

KPI tiles

A row of three groups, each stacking a value and a label.

Loading preview…

paginated-list​

Renders an array as a list and shows it one page at a time, with a one-second cross-fade between pages. Use it for menus, schedules, and directories.

FieldTypeDescription
opts.itemsbindingThe array to display.
opts.pageDurationnumber or "auto"Seconds each page stays on screen. "auto" requires activeOnly.
opts.pageSizenumberOptional. Items per page. If omitted, the player fits as many items as the component height allows.
opts.activeOnlybooleanOptional. Mount only the page on screen. Required for lists of videos.
opts.resumebooleanOptional, with activeOnly. The next play continues where the previous one stopped.
opts.transition"none" or "slide-left"Optional, with activeOnly. How pages change. Default "none" (a cut).
opts.transitionDurationnumberOptional. Seconds the slide takes. Default 1.
componentobjectTemplate for one item. Inside it, $ is the current item. Top-level field, not inside opts.

The widget plays all pages before it ends. The list needs a definite height: give it a fixed height, or "flex": "1 1 auto" with "min-height": "0" inside a column.

Rotating one item at a time​

With activeOnly: true and pageSize: 1 the list shows one item at a time and mounts only that item, so hidden videos never play. Use it to rotate through posts, listings, or products that each fill the widget:

  • "pageDuration": "auto" makes each page last as long as its content, such as the photos of an image-carousel or a video. Pages without timed content last 10 seconds. Until a page has been shown, its length is estimated from the pages measured so far.
  • "resume": true lets a list that is longer than its playlist item be shown in full over several plays. The next play starts with the page that was interrupted, or with the next page if the play showed only one page. Lists with the same widget options share the position.
  • "transition": "slide-left" loads the next page shortly before it is due and slides it in from the right. During the slide both pages are mounted.
{
"type": "paginated-list",
"name": "listings",
"opts": {
"items": { "key": "data.listings" },
"pageSize": 1,
"activeOnly": true,
"pageDuration": "auto",
"resume": true,
"transition": "slide-left",
"transitionDuration": 2
},
"component": {
"type": "group",
"style": { "width": "100%", "height": "100%" },
"components": [
{
"type": "image-carousel",
"name": "photos",
"opts": { "images": { "key": "$.images" }, "imageDuration": 5 },
"style": { "width": "100%", "height": "80%" }
},
{ "type": "text", "name": "address", "opts": { "text": { "key": "$.address" } } }
]
}
}

Each listing above stays on screen for its number of photos × 5 seconds, plus the carousel's transitions.

Upcoming events

Six events shown three per page, with dates formatted by the player.

Loading preview…

The type list is a deprecated alias of paginated-list. Use paginated-list in new widgets.

scroller​

Scrolls an array of items continuously, like a news ticker or a vertical credits roll. The scroller runs for as long as the widget is shown.

FieldTypeDescription
opts.itemsbindingThe array to display.
opts.direction"left", "right", "up", "down"Scroll direction. Default "left".
opts.speednumberSpeed in pixels per second. Default 100.
opts.gapstringSpace between items, as a CSS length. Default "2em".
opts.delaynumberSeconds to wait before scrolling starts. Default 0.
componentobjectTemplate for one item, with $ as the current item.

The scroller repeats the items so that the loop has no visible seam, and clips everything outside its own box. Give it a definite width and height.

note

The gap option relies on flexbox gap, which Chrome 38 does not support. For widgets that must run on legacy players, set "gap": "0" and put a margin on the item template instead, as the example below does.

News ticker

Headlines scroll from right to left in a bar at the bottom of the screen.

Loading preview…

Shows a list of images one after another.

OptionTypeDescription
imagesarray or bindingImage URLs.
imageDurationnumberSeconds per image.
transition"slide" or "fade"Transition between images. Default "slide", which slides and zooms.

Transitions take one second. Images are cached on the device and fill the component (cover). If an image is not cached yet, the carousel loads it from its original URL, which works only while the device is online.

Image carousel

Four photos with a fade transition.

Loading preview…

layout​

Splits the widget into areas and plays a playlist in each one. The built-in layout widgets use this component; for most screens, use the dashboard's layout editor instead. See Layouts.

OptionTypeDescription
containersarrayOne entry per area: playlist (a binding to a playlist) and style (the position of the area), or rect with width, height, top, and left as CSS lengths.

Bind each playlist to an option of type ref with "collection": "playlists". The server resolves the reference to the full playlist when it delivers the widget. The layout lasts as long as its longest playlist.

{
"type": "layout",
"name": "split",
"opts": {
"containers": [
{
"playlist": { "key": "options.left" },
"rect": { "width": "50%", "height": "100%", "top": "0%", "left": "0%" }
},
{
"playlist": { "key": "options.right" },
"rect": { "width": "50%", "height": "100%", "top": "0%", "left": "50%" }
}
]
},
"style": { "position": "relative", "width": "100%", "height": "100%" }
}

qr-code​

Draws a QR code as SVG, so it stays sharp at any size.

OptionTypeDescription
contentstring or bindingThe text or URL to encode.
foregroundColorstringColor of the modules. Default #000000.
backgroundColorstringBackground color. Default #ffffff.
durationnumberDisplay time in milliseconds when the widget has no duration option. Default 10000.

Keep a light margin around the code and enough contrast between the colors, or phones may fail to scan it.

QR code

A QR code next to a call to action.

Loading preview…

Widget duration​

The player decides how long a widget stays on screen in this order:

  1. A display_duration or duration option, in seconds, if the widget defines one in its options schema and the user sets it.
  2. The length of the widget's timeline: video length, all pages of a paginated list, the images of a carousel, or the longest animation.
  3. 10 seconds.

Repeating content counts as one cycle: a scroller contributes the time it takes to scroll its items once, and a looping animation the length of one iteration. Add a duration option when you want the widget to stay on screen for a fixed time:

{
"options_schema": {
"duration": {
"type": "number",
"default": 15,
"min": 5,
"max": 300,
"description": "Seconds on screen"
}
}
}