Skip to main content

stageroutine

Public API surface for StageRoutine.

Everything user-facing is exported flat from the root, so a single import { ... } from "stageroutine" covers the whole library with IDE autocompletion. Tooling and asset entry points:

  • stageroutine/jsx-runtime — JSX runtime (configured as jsxImportSource by the Vite plugin)
  • stageroutine/styles.css — base stylesheet
  • stageroutine/vite — the StageRoutine Vite plugin

A symbol is exported here exactly when it is part of the documented user-facing API. Implementation element classes, fluent builder classes, and engine internals are intentionally not public.

Core​

Coordinate definitions, reactivity primitives, stage configuration, and lifecycle event contracts.

NameDescription
StagePresentation director managing scenes, step transitions, snapshots, and the virtual viewport.
CustomElementOptionsCustom drawing options. Properties use author-defined units.
DOMElementAnimated DOM element instance managed by the reactive Stage runtime. Wraps an underlying HTML/SVG element and exposes bindable transform and visual properties.
ElementOptionsBase positioning and visual options shared across all Stage elements.
GroupElementPublic fluent contract for a logical group of elements.
NavGotoSceneEventCommand event payload to jump directly to a scene index.
NavGotoStepEventCommand event payload to jump directly to a step index.
NavSceneChangedEventEvent payload emitted when the active scene changes.
NavStepChangedEventEvent payload emitted when the active presentation step changes.
OverlayContextContext passed to overlay plugins when they are mounted on the stage. Provides the DOM containers, stage dimensions, navigation methods, and event subscriptions.
OverlayPluginInterface for overlay plugins that attach interactive UI on top of the stage.
PointerSetStateEventCommand payload to set the pointer active state.
PointerStateChangedEventEvent payload emitted when the pointer active state changes.
ReactiveElementBaseBase interface for all reactive presentation elements on stage.
SceneFluent scene contract.
StageContextContext passed to background renderers when they are attached to the stage.
StageEventMapComplete event map for the stage event bus. - Requests (req:*) are imperative instructions sent to the stage (e.g. req:nav:nextStep). - Events (evt:*) are state notifications broadcast by core (e.g. evt:nav:stepChanged).
StageOptionsOptions for initializing the Stage presentation director.
StageResizedEventEvent payload emitted when the stage viewport dimensions change.
StageStateChangedEventComplete state snapshot emitted whenever presentation state changes.
AnchorKeywordStandard named box point keyword.
AnchorModeHow a connector endpoint picks its attachment point on a target outline. "auto" pins to the midpoint of the facing straight side when there is one, otherwise it behaves like "ray". "closest" takes the nearest outline point. "ray" takes the crossing of the direction towards the other endpoint.
CoordPropStage coordinate in stage units (or "center" to center along that axis). Accepts a number, "center", a transition, or a relative-delta updater.
CustomElementCustom numeric properties, animated with .to().
ElementAnchorA point on an element box: a named keyword or an [x, y] percentage pair. Used by element origin and by connector anchors.
ElementChildContent accepted by container factories.
LogLevelMinimal logging API with configurable log levels.
Point2D point as a fixed-length [x, y] tuple.
PositionStage coordinate pair in stage units, or "center" to center on both axes.
PositionCoordCoordinate value on a stage axis: a number in stage units, or "center".
PositionUpdater2D coordinate updater function. Accepts (x, y) or a ([x, y]) tuple and returns the target coordinate in stage units.
ReactivePropRepresents a property that accepts a static value, a reactive transition descriptor, or a numeric relative-delta updater.
SizeElement size in stage units, or an authored CSS length such as "40rem".
UnwrapTransitionUnwraps a potentially animated property type to its underlying raw value.
loggerLogger control object for configuring logging behavior.
ElementWraps custom drawing with snapshot-safe numeric properties.
groupCreates a zero-DOM logical group proxy over multiple stage elements. Grouping allows broadcasting transitions, property mutations, and decorators across elements without adding container elements to the DOM tree.

Components​

Prebuilt elements rendered on the stage, from text and shapes to tables, terminals, and media.

NameDescription
WebcamWebcam utilities and device enumeration.
ActivationBarElementPublic state for a sequence diagram activation.
ActivationOptionsConfiguration options for execution activation bars.
BrowserWindowElementPublic browser window controls.
BrowserWindowOptionsBrowser window options. Default size: 120 × 65 stage units.
BulletItemA single bullet item with optional per-item overrides.
BulletListElementPublic controls for a bullet list.
BulletListOptionsConfiguration options for the BulletList component.
CameraDeviceCamera device info descriptor.
CodeBlockElementPublic controls for a code block.
CodeBlockOptionsConfiguration options for the syntax-highlighted CodeBlock component.
ConnectorElementPublic controls for a connector.
ConnectorOptionsConfiguration options for creating a reactive Connector between two elements or points.
IconDefinitionDefinition for registering an icon namespace or resolver.
IconElementPublic controls for an icon.
IconOptionsConfiguration options for the Icon component.
ImageElementPublic controls for an image.
ImageOptionsConfiguration options for the Image component.
LifelineElementPublic controls for a sequence diagram lifeline.
LifelineOptionsConfiguration options for vertical dashed lifeline timelines.
LiveTerminalElementPublic controls for a live terminal.
LiveTerminalOptionsConfiguration options for the LiveTerminal component.
PeriodicPulseOptionsOptions for continuous periodic packet pulses along a connector.
PulseOptionsOptions for triggering glowing packet animations along a connector.
SequenceDiagramControllerPublic coordinator for a sequence diagram.
SequenceDiagramOptionsConfiguration options for the SequenceDiagram coordinator.
TableElementPublic controls for a table.
TableOptionsConfiguration options for the Table component.
TerminalBlockElementPublic controls for a terminal block.
TerminalBlockOptionsOptions for configuring the TerminalBlock component.
TextElementMutable text content.
TitleOptionsConfiguration options for the Title component.
VideoElementPublic controls for a video.
VideoOptionsConfiguration options for the Video component.
WebcamElementPublic controls for a webcam.
WebcamOptionsConfiguration options for the Webcam component.
BulletItemInputItem specification for a bullet list: plain text, a styled item, or a nested array for indentation.
ConnectorHeadTypeHead marker decoration types at the endpoints of a Connector line.
ConnectorTargetValid endpoint target for a Connector line (DOMElement or point coordinates as an [x, y] tuple).
ImageFitMedia object-fit scaling mode: - "contain" (default): Scales media to fit inside bounds while preserving aspect ratio. - "cover": Zooms and fills bounds completely, cropping overflow. - "fill": Stretches media to exact bounds. - "none": Displays media at intrinsic pixel size. - "scale-down": Scales down like "contain" if larger than container, otherwise behaves like "none".
KickerOptionsConfiguration options for the Kicker component.
LabelOffsetOffset for adjusting label badge position. A number is stage units. A string is a CSS length ("rem", "px"). Accepts a 2D tuple [x, y] or a single vertical offset. e.g. [0, -1.5] or ["2rem", -8].
LabelPlacementNormalized placement along the connector path. - "start": 25% along the path - "center": 50% along the path (default) - "end": 75% along the path - number: explicit fractional ratio from 0.0 to 1.0
TextOptionsConfiguration options for the Text component.
TitleVariantVisual typography variant for the Title component.
BrowserWindowCreates an interactive webpage in a browser window.
BulletListBullet list component with individual bullet point animation and interactive click-and-drag focus.
CardRectangular card container.
CodeBlockCode snippet component with syntax highlighting powered by the Shiki TextMate engine and interactive line/multi-line drag focus.
ConnectorCreates a reactive visual connector / arrow between two nodes or coordinate points.
defineIconsRegisters an icon set or custom SVG icons.
IconCreates a reactive Icon element on stage.
ImageCreates a reactive Image element on stage.
KickerMicro-label component used for chapter indices and section category tags.
LiveTerminalCreates an interactive shell for live demos.
SequenceDiagramCreates a reactive Sequence Diagram coordinator with lifelines and messages.
TableTable component with column alignment, row proxies, and interactive row-level focus.
TerminalBlockTerminal block component with macOS-style window controls and line-by-line interactive focus.
TextBody copy paragraph component formatted for high-legibility stage presentations.
TitleHeadline typography component supporting default title, hero, and serif editorial variants.
VideoCreates a reactive native Video player element on stage.
WebcamCreates a live reactive Webcam element on stage.

Shape & Frame​

Geometry primitives, clipping frames, and path generators.

NameDescription
BoxPathOptionsOptions for the box (rounded rectangle) path generator.
CirclePathOptionsOptions for the circle / ellipse path generator.
DiamondPathOptionsOptions for the diamond path generator.
FrameElementPublic controls for a frame.
FrameOptionsConfiguration options for the Frame clipping component.
HexagonPathOptionsOptions for the hexagon path generator.
PathContextContextual geometry parameters passed to a PathFunction.
PolygonPathOptionsOptions for the regular polygon path generator.
ShapeElementPublic controls for a shape.
ShapeOptionsConfiguration options for the Shape and Card components.
SpeechBubblePathOptionsOptions for the speech bubble path generator.
SquirclePathOptionsOptions for the squircle (superellipse) path generator.
StarPathOptionsOptions for the star path generator.
TailTargetSpecExplicit live tail target with an attachment anchor and clearance padding.
ThoughtBubblePathOptionsOptions for the thought bubble path generator.
TrianglePathOptionsOptions for the triangle path generator.
BubbleTailAccepted forms of the bubble tail option: a length, a local anchor, a target spec, or a bare target element/point for live tracking.
PathFunctionA function that calculates an SVG path string ('d' attribute) for given dimensions.
ShapeVariantSurface material preset for the Shape component.
pathsGeometric SVG path generators for shapes, cards, and clipping frames.
FrameClips media or DOM child elements to an SVG path geometry contour.
ShapeUniversal shape container supporting multiple geometries and surface treatments.

Layout​

Fluent helpers for arranging elements in stacks, grids, and circles.

NameDescription
AlignmentOptionsAlignment of existing elements.
CircleLayoutOptionsOptions for circular/orbit layout arrangement.
GroupLayoutOptionsOptions for rigid-body group transform (uniform scale + translate).
LayoutOptionsShared stack and grid placement options.
LayoutRegionAvailable rectangle in stage units. No DOM container is created.
RelativeLayoutOptionsPlacement relative to an element.
StackLayoutOptionsStack placement and distribution.
Align9-position content alignment grid for text and children inside a container. Single-axis shorthands are centered on the other axis: "top" means top-center, "left" means middle-left.
GridSlotA cell in a grid layout. Empty cells are null or undefined.
LayoutAnimationAnimation configuration for layout placement. Can be: - boolean: true to animate with default duration (0.6s). - Function: A callback receiving (position, element, index) returning a configured transition via to(position).
LayoutElementAny stage element that layout helpers can measure and position.
RelativeAlignEdge alignment within layout space.
StackSlotA slot in a stack layout: either a single element or a nested array of elements (column/row).
layoutOne-shot positioning without DOM containers.

Motion​

Transitions, stagger coordination, and step-driven animation.

NameDescription
BezierMotionOptionsAbsolute cubic Bézier controls in stage units.
ElementPlaneAuthored element geometry with an optional local transform.
ElementTransitionPublic fluent contract for multi-property transitions on an element or group.
PositionTransitionDescriptorPosition transition. Default route: straight.
PulseSequenceControllerController handle returned by pulseSequence().
PulseSequenceOptionsOptions for configuring a multi-connector sequential pulse loop.
PulseSequenceStepStep configuration for a multi-connector sequential pulse chain.
ReplaceOptionsConfiguration options for in-place element replacement transitions.
ReplaceTransitionPublic fluent contract for an in-place replacement operation.
SpiralMotionOptionsSpiral arrival around the destination.
StaggerOptionsConfiguration options for cascading stagger animations across multiple elements.
StaggerTransitionPublic fluent contract for a staggered reveal operation.
TransitionDescriptorFluent builder descriptor returned by to(value) for scheduling transitions.
AnimationMilestoneAnimation milestone representing progress of another element's transition: - "start": Triggers immediately when target element begins animating (progress = 0). - "halfway": Triggers when target element reaches 50% of its easing progress. - "end"
BuiltinEaseBuilt-in named easing curves supported by StageRoutine transitions.
EaseCurveCustom easing function mapping progress t (0..1) to animated value.
ElementTransitionPropsTransition targets from an element's presentation properties.
FlowEffectContinuous ambient stroke animations supported across shapes and connectors.
MotionPathPure route factory. Samples t from 0 (start) to 1 (destination), in stage units.
ProjectedQuadSource corners in stage units: top-left, top-right, bottom-right, bottom-left.
motionReusable route factories for position transitions.
spaceMeasures independently transformed elements in stage units.
pulseSequenceOrchestrates a sequential packet pulse chain across multiple connectors.
replaceCreates an in-place element replacement transition swapping two elements smoothly without ghosting.
staggerCreates a fluent stagger coordinator to cascade animations across a list of elements.
toCreates a fluent transition modifier with a 2D coordinate delta updater. e.g. card.position = to((x, y) => [x, y - 10]).duration(0.4)

Decorators​

Composable visual effects applied to elements and backgrounds.

NameDescription
BracketOptionsConfiguration options for the grouping bracket decorator.
DreamOptionsConfiguration options for the dream liquid decorator.
GlowEffectGlow controller attached to one element.
GlowOptionsGlow appearance and initial strength.
GlowTransitionPropsAnimated glow targets.
GradientOptionsConfiguration options for the linear gradient text decorator.
GrainOptionsConfiguration options for the film grain texture decorator.
KenBurnsKeyframeKeyframe snapshot for Ken Burns camera motion.
KenBurnsOptionsConfiguration options for the Ken Burns camera pan and zoom decorator.
RuleOptionsConfiguration options for rules and dividers.
ScrimOptionsConfiguration options for the background scrim underlay decorator.
ShineEffectOne shared light, attached to one or more elements on the same stage.
ShineOptionsA shared reflection's appearance and initial position.
TransformEffectA transform controller attached to one element.
TransformOptionsLocal transformation of any stage element.
TypewriterOptionsConfiguration options for the typewriter element decorator. All time durations are expressed in seconds (float).
VignetteOptionsConfiguration options for the radial dark vignette decorator.
BracketStyleSupported geometric styles for grouping brackets.
ElementDecoratorCallback function that applies visual effects or behavior to a stage element.
KenBurnsFocusTarget focal anchor point or normalized percentage coordinate pair [x, y].
TransformTransitionPropsAnimation targets for a local transform.
TypewriterStepRepresents an individual action in a structured typewriter script: - string: Types out the text at default speed. - { text: string; speed?: number }: Types out text at an optional custom per-character speed in seconds. - { delete: number; pause?: number; speed?: number }: Backspaces delete count of characters after an optional pause in seconds, with optional backspace speed in seconds. - { pause: number }: Pauses typing for a given duration in seconds.
bracketDecorates an element with a grouping bracket (curly brace, square bracket, or corner frame).
dreamDecorates an element with an optical liquid dream entrance.
glowCreates a theme-coloured glow with snapshot-safe intensity.
gradientDecorates an element with a linear gradient text effect and optional flowing animation.
grainDecorates an element or background with a film grain texture.
kenBurnsDecorates an element or frame with authentic Ken Burns camera panning and slow zooming.
ruleDecorates an element with an accent rule / divider line or curved bracket.
scrimDecorates an element with a soft radial dark aura underlay to make foreground text pop from busy animated backgrounds.
shineCreates one reflection shared by all elements decorated with it.
transformCreates an independent local transform. No animation loop.
typewriterDecorates an element with simulated typing cadence, backspacing, and a blinking cursor.
vignetteDecorates an element or background with a radial dark vignette.

Backgrounds​

Full-bleed renderers drawn behind the stage content.

NameDescription
AsciiFluidOptionsConfiguration options for procedural ASCII fluid simulation background.
BackgroundInterface implemented by dynamic or static stage background renderers.
BackgroundOptionsBase options for background elements.
CSSBackgroundOptionsConfiguration options for full-bleed CSS backgrounds.
GradientFluidOptionsConfiguration options for procedural chromatic gradient fluid background.
StarfieldOptionsConfiguration options for the 3D Starfield background.
BackgroundDecoratorA decorator applied to a background element.
AsciiFluidCreates a procedural ASCII Fluid background element.
CSSBackgroundCreates a full-bleed CSS background supporting colors, gradients, and images.
GradientFluidCreates a procedural continuous Chromatic Gradient Fluid background element.
StarfieldCreates an interactive 3D Starfield background element.

Presenter​

Dual-screen presenter console, laser pointer, and navigation overlays.

NameDescription
PresenterClientClient for synchronizing a custom presenter view with the main presentation window via BroadcastChannel.
PresenterRecorderRecords a presentation at 1440p, up to 60 fps and 24 Mbps.
AnnotationControllerController interface for the annotation overlay.
AnnotationOptionsConfiguration options for the annotation overlay.
LaserPointerControllerExtended controller for the laser pointer overlay, beyond the base OverlayPlugin interface.
LaserPointerOptionsConfiguration options for the laser pointer overlay.
NavigationOverlayOptionsOptions for the navigation overlay.
PresenterRecorderStateRecorder lifecycle and microphone state.
AnnotationCreates an annotation overlay plugin enabling the presenter to draw smooth, luminous ink directly over slide content.
LaserPointerLaser pointer overlay with glowing trail and cursor suppression.
NavigationOverlayCreates a navigation overlay plugin with prev scene, prev step, next step, next scene, and pointer toggle buttons.

Theme​

Color tokens and built-in theme presets.

NameDescription
ThemeConfigTheme configuration object for customizing stage canvas, typography, surfaces, and colors. All properties are optional and strictly typed.
cyberpunkCyberpunk theme preset.
defaultDarkDefault dark theme preset.
defaultLightDefault light theme preset.
draculaDracula theme preset.
themesCollection of all built-in theme presets.
tokyoNightTokyo Night theme preset.

Other​

Type AliasDescription
TerminalStatusLifecycle of a live terminal as seen by the presentation.