Skip to content

Slots and themes, from Essential Graphics to the page ​

A slot is a property the file exposes so it can be changed after export: a colour, an opacity, a position, a scale, a text. A theme is a named set of slot values (Day, Night, Brand). A state machine can switch themes, and a web page can switch themes or set single slots. This page follows one property all the way: After Effects → slot → theme → machine → page.

The tutorials put it to work: Tokens and themes, Themes by example, Themes lab (every kind of slot, animated ones included), Gradient themes, Image themes.

1. A slot starts in Essential Graphics ​

A slot is a property you added to the comp's Essential Graphics panel, the After Effects feature used for Motion Graphics templates. No Essential Graphics, no slot, nothing for a theme to change.

Two ways to add one:

  • In AXO: Interactive Studio → Slots and themes → Add a token. It lists the properties inside the comp that can become slots, with their current value; Add promotes one to Essential Graphics for you.
  • In After Effects: drag the property from the Timeline into the Essential Graphics panel (or right-click it → Add Property to Essential Graphics). Then Rescan in the Studio.

The name in Essential Graphics is the slot's id in the file, the name a theme and your page refer to. Choose it before you export: After Effects cannot rename a promoted property later (remove it and add it again). Two properties with the same name in one comp get (2) added to the second; the same name in different comps is the same id in every file, which is how one page script can recolour several animations. Inside one .lottie with several animations, a slot of the same name but a different value in a second animation ships as name (2). A theme that sets name sets the copy too, and a theme that leaves it alone keeps each animation's own value. A colour token never takes the id of a slot the file already has, nor that of a different token in another animation of the same archive: it ships as name_2, and Build says so.

A property promoted inside a precomp becomes a slot too.

Gradients are the exception: After Effects cannot add a gradient's colours to Essential Graphics. Rename the Gradient Fill or Gradient Stroke to slot: <id> (for example slot: bg) and save the project. The export makes it a slot, and the Studio lists it with one colour per stop. Its colours must not be keyframed. The walk-through: Gradient themes. An image layer is marked the same way (slot: photo): Image themes.

Importing a file brings these two back as the same marks: a gradient slot comes in as a Gradient Fill (or Stroke) named slot: <id>, an image slot as an image layer named slot: <id>. Leave the name alone and the next Build writes the slot again, so a file made in another tool keeps working with its themes.

2. What can be a slot ​

This table comes from the exporter's own code and shows what the file will carry:

WherePropertySlot typeAfter Effects match name
Gradient fill / strokeEnd PointpositionADBE Vector Grad End Pt
Gradient fill / strokeStart PointpositionADBE Vector Grad Start Pt
LayerOpacitynumberADBE Opacity
LayerPositionpositionADBE Position
LayerRotation / Z RotationnumberADBE Rotate Z
LayerScalescaleADBE Scale
LayerX Position (separated)numberADBE Position_0
LayerX RotationnumberADBE Rotate X
LayerY Position (separated)numberADBE Position_1
LayerY RotationnumberADBE Rotate Y
LayerZ Position (separated)numberADBE Position_2
Shape fillColorcolourADBE Vector Fill Color
Shape fillOpacitynumberADBE Vector Fill Opacity
Shape group transformOpacitynumberADBE Vector Group Opacity
Shape group transformPositionpositionADBE Vector Position
Shape group transformRotationnumberADBE Vector Rotation
Shape group transformScalescaleADBE Vector Scale
Shape group transformSkewnumberADBE Vector Skew
Shape group transformSkew AxisnumberADBE Vector Skew Axis
Shape strokeColorcolourADBE Vector Stroke Color
Shape strokeOpacitynumberADBE Vector Stroke Opacity
Text animatorAnchor PointpositionADBE Text Anchor Point 3D
Text animatorFill BrightnessnumberADBE Text Fill Brightness
Text animatorFill ColorcolourADBE Text Fill Color
Text animatorFill HuenumberADBE Text Fill Hue
Text animatorFill SaturationnumberADBE Text Fill Saturation
Text animatorOpacitynumberADBE Text Opacity
Text animatorPositionpositionADBE Text Position 3D
Text animatorRotationnumberADBE Text Rotation
Text animatorScalescaleADBE Text Scale 3D
Text animatorSkewnumberADBE Text Skew
Text animatorSkew AxisnumberADBE Text Skew Axis
Text animatorStroke BrightnessnumberADBE Text Stroke Brightness
Text animatorStroke ColorcolourADBE Text Stroke Color
Text animatorStroke HuenumberADBE Text Stroke Hue
Text animatorStroke OpacitynumberADBE Text Stroke Opacity
Text animatorStroke SaturationnumberADBE Text Stroke Saturation
Text animatorStroke WidthnumberADBE Text Stroke Width
Text animatorTracking AmountnumberADBE Text Tracking Amount
Text range selectorAmountnumberADBE Text Selector Max Amount
Text range selectorEase HighnumberADBE Text Levels Max Ease
Text range selectorEase LownumberADBE Text Levels Min Ease
Text range selectorEndnumberADBE Text Percent End
Text range selectorEnd (index)numberADBE Text Index End
Text range selectorStartnumberADBE Text Percent Start
Text range selectorStart (index)numberADBE Text Index Start
Text layerSource TexttextADBE Text Document
Never a slotWhyAfter Effects match name
Anchor pointthe player refuses or blanks the fileADBE Anchor Point
Shape group anchorthe player refuses or blanks the fileADBE Vector Anchor
Shape paththe player draws nothing at allADBE Vector Shape
Rectangle sizethe player draws nothing at allADBE Vector Rect Size
Rectangle positionthe player draws nothing at allADBE Vector Rect Position
Rectangle roundnessthe player draws nothing at allADBE Vector Rect Roundness
Ellipse sizethe player draws nothing at allADBE Vector Ellipse Size
Ellipse positionthe player draws nothing at allADBE Vector Ellipse Position
Star pointsthe player draws nothing at allADBE Vector Star Points
Star positionthe player draws nothing at allADBE Vector Star Position
Star rotationthe player draws nothing at allADBE Vector Star Rotation
Star inner radiusthe player draws nothing at allADBE Vector Star Inner Radius
Star outer radiusthe player draws nothing at allADBE Vector Star Outer Radius
Star inner roundnessthe player draws nothing at allADBE Vector Star Inner Roundess
Star outer roundnessthe player draws nothing at allADBE Vector Star Outer Roundess
Trim startthe player draws nothing at allADBE Vector Trim Start
Trim endthe player draws nothing at allADBE Vector Trim End
Trim offsetthe player draws nothing at allADBE Vector Trim Offset
Round cornersthe player draws nothing at allADBE Vector RoundCorner Radius
Offset paththe player draws nothing at allADBE Vector Offset Amount
Offset path miterthe player draws nothing at allADBE Vector Offset Miter Limit
Pucker & bloatthe player draws nothing at allADBE Vector PuckerBloat Amount
Twist anglethe player draws nothing at allADBE Vector Twist Angle
Twist centrethe player draws nothing at allADBE Vector Twist Center
Zigzag sizethe player draws nothing at allADBE Vector Zigzag Size
Zigzag detailthe player draws nothing at allADBE Vector Zigzag Detail
Repeater copiesthe player draws nothing at allADBE Vector Repeater Copies
Repeater offsetthe player draws nothing at allADBE Vector Repeater Offset
Repeater positionthe player draws nothing at allADBE Vector Repeater Position
Repeater anchorthe player refuses or blanks the fileADBE Vector Repeater Anchor
Repeater scalethe player draws nothing at allADBE Vector Repeater Scale
Repeater rotationthe player draws nothing at allADBE Vector Repeater Rotation
Repeater start opacitythe player draws nothing at allADBE Vector Repeater Opacity 1
Repeater end opacitythe player draws nothing at allADBE Vector Repeater Opacity 2
Stroke widthplays, but any theme makes the player drop the strokeADBE Vector Stroke Width
  • The “never” rows were each measured in the dotLottie player: a slot there blanks the drawing, makes the player refuse the file, or (stroke width) drops the stroke as soon as any theme is applied. AXO exports those properties with their value and no slot, and the Studio says why when you try.
  • Effects (a Drop Shadow's colour, a Slider or Color Control) are not in the first table: they ship with no slot type, and no player applies a theme to effect settings. The Studio marks them themes do not change this. To theme a shadow or a glow, put that colour on a shape fill or on text.
  • The text-animator rows are what the exporter writes; the player was measured on fills, strokes, layer and group transforms and gradient points.

3. How it reaches the file ​

  • Slots are written when the comp is interactive (Build → lottie, Ship this comp as interactive). AXO switches slots on by itself when the comp has promoted properties, and says so in the build log.
  • The comp's .json carries the slots too, with their values, and nothing else: themes and state machines exist only inside the .lottie.
  • In the file, a slot is the property's sid plus an entry in the animation's slots map holding the value.

4. Themes ​

A theme is a column in Slots and themes: one value per slot. A new column starts from the defaults (the values set in After Effects); change any of them.

  • Every slot in every theme. AXO writes each theme with all slots, the unchanged ones at their default. That matters when a page switches themes: the dotLottie player keeps the value a previous theme set for any slot the next theme does not mention (measured), so a theme written by another tool may leave colours behind, so call resetTheme() first.
  • Nothing is applied by itself. The player does not apply the file's first theme on load (measured, dotlottie-web 0.80): the page calls setTheme(id) after load, or a state machine switches it.
  • A layer's own Transform shows on the next frame. In the dotLottie player, a theme value on a layer's Opacity, Position, Scale or Rotation is drawn only when the frame changes (measured, dotlottie-web 0.81); colours and shape-group transforms switch at once. On a playing animation you will not notice. On a paused one, or a state machine waiting on a state, the theme looks half applied: after setTheme, step the frame off and back (setFrame(f - 1), setFrame(f)). AXO's Preview does this for you. A shape group's transform has no such delay, so prefer it when the theme must apply while the animation stands still.
  • Colours are opaque in a theme. The dotLottie player ignores the alpha of a theme colour (measured, dotlottie-web 0.81). For transparency, use an opacity slot.
  • Animated slots: a slot whose property has keyframes can be captured (the theme carries the animation), followed (the theme keeps the comp's own keys) or frozen at one value. See Themes lab.
  • Text: a theme can change a Source Text slot's text, size and colour (the Studio edits those three; the rest of the text document is kept). In the dotLottie player, any text rule makes the text fall back to the player's own font (measured on an earlier player version). Check the result in Preview. If the comp's text is exported as glyph shapes, only the characters the comp used exist in the file.
  • Gradients: a theme sets every stop's colour; positions and transparency come from the comp. dotLottie only; lottie-web draws the comp's own gradient (Gradient themes).
  • Images: name an image layer slot: <id> and a theme can swap its picture; the Studio's cell has Choose… (Image themes). dotLottie only; lottie-web shows the comp's picture.

5. From a state machine ​

A Switch theme action names a theme by its file id (shown in the Studio). It works on entering a state (the music player switches theme with the track) and straight from a click (the thermostat's mode chips). While a segment plays, the next frame shows it. On a parked state (no autoplay, one frame) nothing is drawn until the frame changes, and a position or scale rule appears one draw after the colours (measured, dotlottie-web 0.80). The thermostat shows the fix: A parked picture does not redraw by itself.

6. From a web page ​

js
import { DotLottie } from "https://cdn.jsdelivr.net/npm/@lottiefiles/dotlottie-web@0.81.0/+esm"; // the version these pages use
const player = new DotLottie({ canvas, src: "card.lottie" });
player.addEventListener("load", () => {
  player.setTheme("night");                          // a theme from the file, by id
  player.setColorSlot("accent", [0.95, 0.7, 0.16]);  // one slot: colours are 0–1, not 0–255
  player.setScalarSlot("glow", 40);                  // a number slot
  console.log(player.getSlotIds());                  // every slot the file exposes
});
// player.resetTheme() — back to the file's own values; player.resetSlots() — undo single-slot changes.
  • A value must match the slot's type: a number rule on a scale slot makes the player draw nothing (measured), not ignore it. Position and scale take as many numbers as the slot holds.
  • getSlot(id) returns the property object ({ a, k }), not a bare value.
  • lottie-web (no .lottie, no themes) draws the values in the JSON's slots map (measured on 5.13): edit that map before loadAnimation to recolour there.

AXO for After Effects