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
string
required
Asset manifest key for a
spine asset. The loaded SkeletonData is resolved automatically.number
Desired display width in pixels. When provided, the skeleton is scaled to fit. If only
width is given, the skeleton is scaled proportionally.number
Desired display height in pixels. When provided, the skeleton is scaled to fit. If only
height is given, the skeleton is scaled proportionally.PixiPoint
Controls the pivot point of the skeleton.
0 = top-left, 0.5 = centre. Accepts a number or { x, y }. Default undefined.PixiPoint
Additional scale multiplier applied on top of the width/height-derived scale. Accepts a number or
{ x, y }. Default { x: 1, y: 1 }.number
Horizontal position. Default
0.number
Vertical position. Default
0.number
Opacity from
0 to 1. Default 1.boolean
Whether the skeleton is rendered. Default
true.number
Sort order within the parent. Default
0.boolean
When
true, logs an error and dumps loadedAssets to the console if the key is not found. Useful during development.Cursor
CSS cursor string.
Snippet
required
<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
SPINE_PIXI.SkeletonData
required
A fully loaded Spine skeleton data object. Passed directly to
new SPINE_PIXI.Spine(spineData).number
Horizontal position. Default
0.number
Vertical position. Default
0.number | PointData
Scale applied to the spine object. Default
1.number | PointData
Pivot point for rotation and positioning.
number
Opacity. Default
1.boolean
Whether the skeleton is rendered. Default
true.number
Sort order within the parent. Default
0.Cursor
CSS cursor string.
Snippet
required
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
number
required
The track index to set the animation on. Track
0 is the base layer; higher indices layer on top.string
required
The name of the animation to play, as defined in the Spine editor.
boolean
Whether the animation loops. Default
false.number
Playback speed multiplier for this track.
1 = normal, 2 = double speed. Inherited from SPINE_PIXI.TrackEntry.number
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
string
required
The name of the bone to control, as defined in the Spine editor.
number
Local x position of the bone.
number
Local y position of the bone (negated before being written to Spine’s coordinate system).
number
Local rotation of the bone in degrees (Spine’s native unit).
number
Local x scale of the bone.
number
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
string
required
The name of the slot to attach to, as defined in the Spine editor.
Snippet
required
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
Snippet
required
<SpineTrack>, <SpineSlot>, and <SpineBone> components.