Overview
Spine integration is built on@esotericsoftware/spine-pixi-v8. Load skeleton data via the asset manifest with type: 'spine', then compose the animation with the components below.
A typical hierarchy:
<SpineProvider>
The root component for a Spine skeleton. Looks up theSkeletonData from stateApp.loadedAssets by key, calculates scale from the declared width/height, and provides the Spine instance to all child components via context.
Props
Asset manifest key for a
spine asset. The loaded SkeletonData is resolved automatically.Desired display width in pixels. When provided, the skeleton is scaled to fit. If only
width is given, the skeleton is scaled proportionally.Desired display height in pixels. When provided, the skeleton is scaled to fit. If only
height is given, the skeleton is scaled proportionally.Controls the pivot point of the skeleton.
0 = top-left, 0.5 = centre. Accepts a number or { x, y }. Default undefined.Additional scale multiplier applied on top of the width/height-derived scale. Accepts a number or
{ x, y }. Default { x: 1, y: 1 }.Horizontal position. Default
0.Vertical position. Default
0.Opacity from
0 to 1. Default 1.Whether the skeleton is rendered. Default
true.Sort order within the parent. Default
0.When
true, logs an error and dumps loadedAssets to the console if the key is not found. Useful during development.CSS cursor string.
<SpineTrack>, <SpineSlot>, <SpineBone>, and <SpineEventEmitterProvider> components.<SpineProvider> uses {#key spineData} internally — the entire subtree is remounted whenever the resolved skeleton data changes.<BaseSpineProvider>
The lower-level Spine component used internally by<SpineProvider>. Use it directly when you already have a SPINE_PIXI.SkeletonData object and do not need the key-lookup and auto-scaling behaviour.
Props
A fully loaded Spine skeleton data object. Passed directly to
new SPINE_PIXI.Spine(spineData).Horizontal position. Default
0.Vertical position. Default
0.Scale applied to the spine object. Default
1.Pivot point for rotation and positioning.
Opacity. Default
1.Whether the skeleton is rendered. Default
true.Sort order within the parent. Default
0.CSS cursor string.
Spine child components.
<SpineTrack>
Plays a named animation on a specific track of the parent<SpineProvider> skeleton. Must be a child of <SpineProvider> or <BaseSpineProvider>.
When trackIndex or animationName changes, the previous animation is cleared with setEmptyAnimation before the new one starts.
Props
The track index to set the animation on. Track
0 is the base layer; higher indices layer on top.The name of the animation to play, as defined in the Spine editor.
Whether the animation loops. Default
false.Playback speed multiplier for this track.
1 = normal, 2 = double speed. Inherited from SPINE_PIXI.TrackEntry.Mix alpha (blend weight) for this track.
1 = full influence. Inherited from SPINE_PIXI.TrackEntry.Example
<SpineBone>
Directly manipulates a named bone in the parent skeleton. All props fromSPINE_PIXI.Bone are accepted and synced reactively.
The
y axis is inverted — <SpineBone> negates the y value before writing it to the bone (bone.y = -props.y). This matches the Svelte/PixiJS coordinate system where y increases downward.Props
The name of the bone to control, as defined in the Spine editor.
Local x position of the bone.
Local y position of the bone (negated before being written to Spine’s coordinate system).
Local rotation of the bone in degrees (Spine’s native unit).
Local x scale of the bone.
Local y scale of the bone.
Example
<SpineSlot>
Attaches a container to a named slot in the parent skeleton. Child components are positioned and transformed to follow that slot’s world transform each frame. When used inside a<SpineEventEmitterProvider>, the slot’s children are hidden automatically when the slot has no active attachment.
Props
The name of the slot to attach to, as defined in the Spine editor.
Components to render inside the slot container. They are positioned relative to the slot’s world transform.
Example
<SpineEventEmitterProvider>
Wraps a<SpineProvider> subtree and bridges Spine’s beforeUpdateWorldTransforms and afterUpdateWorldTransforms lifecycle hooks into a PixiJS EventEmitter. Required for <SpineSlot> visibility toggling based on slot attachment state.
Must be placed inside a <SpineProvider>.
Props
<SpineTrack>, <SpineSlot>, and <SpineBone> components.