You are reading the development docs (2026.12.1-dev.1): features here may not be released yet.
Skip to content

Background Animations ​

background_animation draws moving layers behind a card's content: grids, starfields, nebulae, an LCARS data cascade, a warp field, a rotating planet. It works on the button, elbow, slider, MSD and astrometrics cards.

  • The value is a list of effects. Each entry names a preset and gives that preset's keys in config; the first entry is the bottom layer.
  • The background sits behind the card's own fill, so it shows best on a card with a transparent fill, such as the button's outline preset, or inside an elbow's arms.
  • On the MSD card it goes under msd: (msd.background_animation); on every other card it is a top-level key.

Try it

  • The button and elbow editors have a Background Animation section on the Effects tab, with every preset's keys and a live preview. The MSD and Astrometrics Studios have one too.
PageCovers
Preset ReferenceEvery preset and its config keys
Stacking and ZoomLayering several effects, the zoom wrapper, example backgrounds
Binding and AnimationKeys that follow an entity, animating the background from triggers and rules, the animatable keys

Quick start ​

Two backgrounds to start from: a scrolling grid behind a button, and a data cascade inside an elbow's arms.

  • Give the card some height (grid_options.rows in a sections view) so there is room to see the effect.
  • On an elbow, inset: auto keeps the background inside the bars; see Canvas options.
yaml
type: custom:lcards-button
preset: outline
text:
  name:
    content: SENSOR GRID
    show: true
grid_options:
  rows: 3
background_animation:
  - preset: grid
    config:
      line_spacing: 30
      color: alpha(var(--lcars-orange), 0.4)
      scroll_speed_x: 15
      scroll_speed_y: 15
yaml
type: custom:lcards-elbow
grid_options:
  rows: 4
elbow:
  type: header-left
  segment:
    bar_width: 90
    bar_height: 20
    color: var(--lcars-orange)
background_animation:
  inset: auto # inside the bars
  effects:
    - preset: cascade

Available presets ​

preset picks the effect; the Preset Reference lists each one's config keys. There are seventeen.

  • config is optional for most presets: a key you leave out takes the preset's default. image needs a source.
  • The presets marked WebGL draw on the GPU where the browser has WebGL and fall back to a Canvas2D version where it does not; see WebGL presets.
PresetDraws
gridA grid with optional major and minor lines; polar rings and spokes (pattern: polar); on WebGL also a perspective floor (view: floor) or a cylinder, dome, sphere or funnel (surface)
grid-diagonalDiagonal hatching (WebGL)
grid-hexagonalA honeycomb (WebGL)
starfieldScrolling stars in parallax depth layers
nebulaSoft nebula clouds; volumetric: true shades them with noise on WebGL
contour-fieldBanded contours like a star chart (WebGL)
cascadeThe LCARS data waterfall: rows of numbers cycling colour
levelA fill bar with waves and sloshing, for a tank or gauge
fluidA swirling colour wash (WebGL)
plasmaTwo-colour plasma bands (WebGL)
flowStreaks streaming in one direction
shimmerA highlight band sweeping across
scanlinesCRT-style scanlines
imageAn image, fixed or from an entity
solidA flat colour
warp-starfieldStars flying at you in 3D, streaking at speed (WebGL; starfield without it)
holo-sphereA rotating wireframe planet with a scan band (WebGL; the same look on Canvas2D)

WebGL presets ​

Some presets draw on the GPU with three.js where the browser has WebGL, and fall back to Canvas2D where it does not, so the background never goes blank. renderer on the entry chooses.

  • warp-starfield and holo-sphere are three.js scenes. Without WebGL, warp-starfield draws a starfield and holo-sphere the same sphere on Canvas2D.
  • grid, grid-diagonal and grid-hexagonal draw the same pixels as their Canvas2D versions in the flat view. On WebGL they also do a perspective floor with a camera (grid views), cylinders, domes and spheres seen from outside or inside (grid surfaces), and funnels that can morph and ripple (grid wells).
  • contour-field, plasma and fluid draw the same field on the GPU, with the same keys. On WebGL their noise keys become animatable.
  • nebula uses WebGL only with volumetric: true (opt-in, because it changes the look); without WebGL it draws the plain clouds.
yaml
type: custom:lcards-button
preset: outline
text:
  name:
    content: WARP
    show: true
grid_options:
  rows: 3
background_animation:
  - preset: warp-starfield
    config:
      count: 400
yaml
type: custom:lcards-button
preset: outline
text:
  name:
    content: CANVAS2D
    show: true
grid_options:
  rows: 3
background_animation:
  # always the Canvas2D version: for warp-starfield, a starfield
  - preset: warp-starfield
    renderer: canvas
    config:
      count: 400
More about WebGL presets
  • One context: a WebGL preset loads only when a card uses it, and all of them share one WebGL context across the dashboard. Each sits in the stack like any other entry.
  • Why the GPU helps the noise presets: on the CPU, contour-field, plasma and fluid work out their whole field when they first draw, resize or change alert colours, which can pause the page for a moment on a large background. On the GPU they don't.
  • A lost context: if the graphics context is lost (a GPU reset, a tablet app hiding the dashboard), the entry draws its Canvas2D version and goes back to the three.js scene within a few seconds, once the graphics work again. If a scene fails to start, or the context is lost three times within two minutes, that entry keeps its Canvas2D version until the page is reloaded.
  • Off-screen: a three.js scene gives the shared context back while its card is off the page.
KeyTypeDefaultDescription
rendererstringautoauto: WebGL when the browser has it, Canvas2D otherwise. webgl: the same, stated outright. canvas: always the Canvas2D version (no GPU use). Presets that are Canvas2D only ignore it

Effect options ​

The keys of one entry in the list: which preset, its settings, and how it is drawn. Any number of entries can be stacked; see Stacking and Zoom.

  • Colours in config take every LCARdS colour form: CSS variables, theme: tokens, alpha() and the other computed colours, rgba and hex. See Colours.
  • Any config value can follow an entity with map_range or a template; see Binding and Animation.
yaml
type: custom:lcards-button
preset: outline
text:
  name:
    content: DEFLECTOR
    show: true
grid_options:
  rows: 3
background_animation:
  - preset: starfield
    config:
      count: 150
      speed: 0.5 # half speed
  # kept in the list, drawn only once enabled
  - preset: grid
    enabled: false
    config:
      color: alpha(var(--lcars-orange), 0.3)
More about effect options
  • speed and the zoom wrapper: speed also runs the zoom cycle faster, whether it is fixed in config, bound to an entity or animated.
  • Disabled entries keep their place: an entry with enabled: false still counts when an animation picks an entry by number (effect:).
KeyTypeDefaultDescription
presetstringrequiredThe effect: see Available presets
configobjectthe preset's defaultsThe preset's own keys: see the Preset Reference
config.speednumber1Time multiplier for every preset that moves (all but image and solid): 2 is twice as fast, 0 freezes it. On shimmer it is the sweep speed in px per second (default 6)
enabledbooleantruefalse keeps the entry in the list but draws nothing
rendererstringautoFor presets with a WebGL version: see WebGL presets
transitionnumber500Milliseconds an entity-bound value takes to glide to a new value. 0 snaps
zoomobject-Draws the effect as layers zooming outward: see Zoom wrapper

Canvas options ​

To set where the background is drawn, or its frame rate, write background_animation as an object with the list under effects. inset keeps the canvas off the card's edges, for a sidebar or footer bar that should stay clear.

  • inset: auto works on elbow cards: it fits the canvas inside the elbow's arms and follows the bars when they change. The elbow's appearance page covers how it treats each elbow type. On every other card auto means no inset.
  • A side you leave out of an inset object is 0.
  • fps caps how often the background redraws. It is read only in the object form.
yaml
type: custom:lcards-button
preset: outline
text:
  name:
    content: CANVAS INSET
    show: true
grid_options:
  rows: 3
background_animation:
  inset:
    left: 60 # keep the left 60 px clear
    bottom: 20
  effects:
    - preset: grid-hexagonal
      config:
        hex_radius: 20
        color: alpha(var(--lcars-ice), 0.4)
More about canvas options
  • Frame rate: the default cap of 30 frames per second is plenty for ambient motion and spares low-end devices such as wall tablets. Set 60 for a smoother look on a desktop or high-refresh screen; 0 removes the cap. The editor's Canvas Settings section sets it.
  • Size: the canvas follows the card's size as it changes (a sections grid settling, the sidebar opening), less the inset, and is never smaller than 1 px.
KeyTypeDefaultDescription
background_animationlist / object-A list of effects, or an object with effects, inset and fps
effectslistrequired in the object formThe effects, bottom layer first: see Effect options
insetstring / objectnoneauto: inside an elbow's arms (no inset on other cards). An object: px per side
inset.topnumber0Space kept clear at the top, px
inset.rightnumber0Space kept clear on the right, px
inset.bottomnumber0Space kept clear at the bottom, px
inset.leftnumber0Space kept clear on the left, px
fpsnumber30Most frames per second the background draws. 0: no cap

Troubleshooting ​

When a background doesn't show, looks wrong or slows a device down, check these first.

  • Nothing shows: the card's own fill may cover it (try the button's outline preset), the colour may be fully transparent, or the card may have no height to draw in. A preset name the card doesn't know is logged in the browser console and that entry is skipped.
  • A colour doesn't resolve: check that a theme: token path exists in the active theme (Themes). Quote hex colours ("#ff9966"): unquoted, YAML reads everything after # as a comment.
  • A device slows down: use fewer stacked effects and fewer zoom layers, wider line_spacing, and set scroll speeds to 0 where you don't need the motion.
More about how a background runs
  • Pauses on its own: the background stops drawing while its card is scrolled off the page or the browser tab is hidden, and carries on where it left off.
  • Reduced motion: when the device asks for reduced motion, the background draws one frame and holds it.
  • A struggling device: if the frame rate falls very low, the background pauses itself and tries again later.
  • Patterns that line up: stacked grids line up best with the same line_spacing (or multiples of it), and major line intervals that divide the card's size evenly.
  • A different system: Animations animate a card's own parts; background animations are drawn on a canvas behind them. An animation can still target the background. Filters are SVG filter effects on the card.

Released under the MIT License. | About