# Show a Spine animation on a web page

> Embed a Spine 4.2 animation from Animate4Me in any web page with the official Spine Web Player: two files, a div and a few lines of code. Transparent background included.

Page: https://animate4me.com/spine-web-player-embed.html

Want to show an animated icon or character on a portfolio, a store page or a design review, without a game engine? The official **Spine Web Player** from Esoteric Software plays a Spine export in any web page.

We ran the code below with spine-player 4.2.120 on our [example export](https://animate4me.com/download/animate4me_ring_v2_spine42.zip) (0.5 MB).

[Try it](https://animate4me.com/app.html) [See pricing](https://animate4me.com/pricing.html)

## How do I put a Spine animation on a web page?

Animate4Me gives you a Spine 4.2 export, and the official Spine Web Player plays it in a div with a few lines of code.

**Best for:** artists, studios and developers who want to show Spine animations on a website or in a review page.

**Key advantages:**

- No game engine and no build step: two script and style files from a CDN.
- Transparent background, so the animation sits on your page design.
- Pick the start animation, or let visitors switch between them.
- Straight-alpha pages that render clean edges.

**What you get:** one ZIP with skeleton.json, skeleton.atlas, a PNG page and a README; 20 tokens per symbol or object from your image.

## The code

Upload the three files from the ZIP into one folder on your site, for example `/spine/ring/`. Then add this to your page:

```
<script src="https://unpkg.com/@esotericsoftware/spine-player@4.2.*/dist/iife/spine-player.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@esotericsoftware/spine-player@4.2.*/dist/spine-player.css">

<div id="ring" style="width: 320px; height: 320px;"></div>

<script>
  new spine.SpinePlayer("ring", {
    skeleton: "/spine/ring/skeleton.json",
    atlas: "/spine/ring/skeleton.atlas",
    animation: "idle",
    premultipliedAlpha: false,   // our atlas pages are straight alpha
    alpha: true,                 // transparent canvas
    backgroundColor: "#00000000",
    showControls: false
  });
</script>
```

The version in the URL (`4.2`) must match the Spine version of the export. The player loads the PNG page named in the atlas from the same folder.

## Useful options

- `animation`: the animation to start with, for example `"win"`.
- `animations`: a list the visitor can choose from, when `showControls` is on.
- `backgroundColor`: an RGBA hex colour such as `"#16181dff"` for a solid background.
- `viewport`: a fixed frame instead of the automatic fit, if the animation should not resize when it changes.

The player fills its container element, so the size of the `div` sets the size of the animation.

## Hosting notes

- Serve the files from your own site or from a host that allows cross-origin requests; the player loads them with JavaScript.
- Opening the page as a local file (`file://`) does not work in most browsers. Use a local web server for testing.
- Spine runtimes, including the Web Player, are covered by the Spine Runtimes License: using them in your product needs your own Spine licence from Esoteric Software.

## What is in the export?

- `skeleton.json`: Spine 4.2 skeleton data with bones, weighted meshes and one named animation per template you chose (for example `idle` and `win`).
- `skeleton.atlas`: the texture atlas description. Its header says `pma: false`: the pages are straight alpha, not premultiplied.
- `skeleton.png`: the atlas page. A symbol or object export is one page, usually about 450 to 1,500 px on each side, in a ZIP of about 0.1 to 1.8 MB.
- `README.txt`: the animation list and loading notes.

You can also open the export in a game engine: see the guides for [PixiJS](https://animate4me.com/spine-animation-for-pixijs.html) and [Phaser](https://animate4me.com/spine-animation-for-phaser.html).

## How much does it cost?

A symbol or object animation from your image costs **20 tokens**, from a text prompt **30 tokens**; a character costs **60 tokens** from an image. Tokens come with a monthly plan: **Indie** $19 a month for 300 tokens, **Studio** $59 a month for 1200 tokens, **Pro** $199 a month for 5000 tokens. There is no free trial and there are no free tokens. Your first plan payment comes with a 7-day money-back, see the [Refund Policy](https://animate4me.com/refund.html); if an animation fails on our side, its tokens are returned automatically.

## Questions and answers

### Which Spine Web Player version do I need?

Version 4.2, the same as the export: load @esotericsoftware/spine-player@4.2.*.

### How do I get a transparent background?

Set alpha: true and backgroundColor: "#00000000" in the player configuration.

### Why does it not load when I open the HTML file directly?

Browsers block JavaScript file loading from file:// pages. Serve the page from a web server.

### Can visitors switch animations?

Yes. Leave showControls on and list the animations in the animations option.

### Do I need a Spine licence?

The exported files are yours. To play them in your own product with an official Spine Runtime you need your own Spine licence from Esoteric Software, the same as for any Spine export.

## Related

- [Spine animation for PixiJS](https://animate4me.com/spine-animation-for-pixijs.html)
- [Spine animation for Phaser](https://animate4me.com/spine-animation-for-phaser.html)
- [Spine export for game engines](https://animate4me.com/spine-export-for-game-engines.html)
- [Image to Spine animation](https://animate4me.com/image-to-spine.html)
- [Animate4Me home](https://animate4me.com/)

## Make a Spine animation for your web page.

[Try it](https://animate4me.com/app.html)

[Plans and token prices](https://animate4me.com/pricing.html)

---

Animate4Me: https://animate4me.com/ · Contact: contact@animate4me.com · X: https://x.com/Animate4Me · All pages for AI assistants: https://animate4me.com/llms.txt

Spine is a trademark of Esoteric Software. Animate4Me is not affiliated.
