# Rupamotion Player > Rupamotion Player (@rupamotion/player) plays and controls the animations a Rupamotion export writes: CSS and SVG animations in any page or framework. These files are the documentation for AI tools: the pages of the latest version are listed below, each also at its own .md URL, and the whole version is one Markdown file. ## Pages - [Introduction](https://player.rupamotion.com/start/introduction/): What @rupamotion/player is, what it adds to a Rupamotion export, and when you need it. - [Installation](https://player.rupamotion.com/start/installation/): Install @rupamotion/player from npm or load it from a CDN, and what TypeScript needs. - [Quick start](https://player.rupamotion.com/start/quick-start/): Play an exported .rupaplay file in a page with one script line and one element. - [Choose a way](https://player.rupamotion.com/guides/choose-a-way/): Three ways to use the player: your own markup, the full snippet, or the file alone. - [Your own markup](https://player.rupamotion.com/guides/your-markup/): Keep your own headings and text and let a .rupaplay file add the design, animation and control. - [The full snippet](https://player.rupamotion.com/guides/full-snippet/): Use the exported markup and CSS in your page and add the player from npm or a CDN to control it. - [The file alone](https://player.rupamotion.com/guides/file-alone/): Load a .rupaplay file with the rupa-player element and let it write the markup and CSS. - [Control playback](https://player.rupamotion.com/guides/control/): Play, pause, seek and change the speed of an animation, and move between its states. - [Events](https://player.rupamotion.com/guides/events/): Listen to statechange, complete, play, pause and error on a player, and the DOM events of the element. - [Errors and inert players](https://player.rupamotion.com/guides/errors/): How the player reports failures: file errors, the fatal error event, and what an inert player does. - [Large animations](https://player.rupamotion.com/guides/large-animations/): How long a large .rupaplay file takes to install, and how to keep a page with thousands of animated elements fast. - [Security](https://player.rupamotion.com/guides/security/): How the player treats a .rupaplay file as untrusted data: sanitising, integrity checks, size limits and Trusted Types. - [Development build](https://player.rupamotion.com/guides/development-build/): Select the development export condition to get console warnings about unknown classes, malformed tables and newer files. - [Server rendering](https://player.rupamotion.com/guides/server-rendering/): The player imports on any server and does nothing there, so server-rendered markup stays and the motion starts in the browser. - [HTML](https://player.rupamotion.com/frameworks/html/): Use the rupa-player element in plain HTML with one script line from a CDN. - [JavaScript](https://player.rupamotion.com/frameworks/javascript/): Load a .rupaplay file from plain JavaScript or any bundler with mountFile and control the player it returns. - [React](https://player.rupamotion.com/frameworks/react/): Use RupaPlayer, useRupaPlayer and usePlayerState with React 18 or 19, and the element or mountFile on React 16 and 17. - [Next.js](https://player.rupamotion.com/frameworks/nextjs/): Use RupaPlayer in a Next.js client component: the text renders on the server and the motion starts after hydration. - [Vue](https://player.rupamotion.com/frameworks/vue/): Use the rupa-player custom element in Vue after telling the compiler it is a custom element. - [Nuxt](https://player.rupamotion.com/frameworks/nuxt/): Use the rupa-player custom element in Nuxt, loaded in onMounted so server rendering keeps your text. - [Svelte](https://player.rupamotion.com/frameworks/svelte/): Use the rupa-player custom element in a Svelte component. - [SvelteKit](https://player.rupamotion.com/frameworks/sveltekit/): Load the rupa-player element in onMount so server rendering keeps your text and the player starts in the browser. - [Solid](https://player.rupamotion.com/frameworks/solid/): Use the rupa-player custom element in Solid. - [Angular](https://player.rupamotion.com/frameworks/angular/): Use the rupa-player custom element in an Angular component with CUSTOM_ELEMENTS_SCHEMA. - [Preact](https://player.rupamotion.com/frameworks/preact/): Use the rupa-player custom element in Preact. - [Lit](https://player.rupamotion.com/frameworks/lit/): Use the rupa-player custom element inside a Lit template. - [Astro](https://player.rupamotion.com/frameworks/astro/): Use the rupa-player custom element in an Astro page, with the script bundled once per page. - [API reference](https://player.rupamotion.com/reference/api/): The four entries of @rupamotion/player and the functions, types and components each one exports. - [@rupamotion/player](https://player.rupamotion.com/reference/api/rupamotion/player/): @rupamotion/player: the core, mount and its types. - [@rupamotion/player/element](https://player.rupamotion.com/reference/api/rupamotion/player/element/): @rupamotion/player/element: imported, it defines (if no other copy of the player did) and mounts every snippet root of the page that has a table, now and after DOMContentLoaded. - [RupaPlayerElement](https://player.rupamotion.com/reference/api/rupamotion/player/element/interfaces/rupaplayerelement/): : a .rupaplay file mounted into the element, defined by importing @rupamotion/player/element (or loading its CDN script). - [@rupamotion/player/file](https://player.rupamotion.com/reference/api/rupamotion/player/file/): @rupamotion/player/file: loads a .rupaplay file and mounts the player on its markup. - [FileError](https://player.rupamotion.com/reference/api/rupamotion/player/file/interfaces/fileerror/): The error of a failed load or mount: an Error whose message (@rupamotion/player: …) says what failed, in every build, with its code. - [LoadOptions](https://player.rupamotion.com/reference/api/rupamotion/player/file/interfaces/loadoptions/): The options of loadFile (and of mountFile, which adds its own). - [MountFileOptions](https://player.rupamotion.com/reference/api/rupamotion/player/file/interfaces/mountfileoptions/): The options of mountFile: the loader's (integrity) and how the file meets the root. - [RupaFile](https://player.rupamotion.com/reference/api/rupamotion/player/file/interfaces/rupafile/): A .rupaplay file, version 1: what the export writes (gzipped JSON) and loadFile reads. - [FileErrorCode](https://player.rupamotion.com/reference/api/rupamotion/player/file/type-aliases/fileerrorcode/): What a failed load or mount tells (error.code), and what to do: - [FileSource](https://player.rupamotion.com/reference/api/rupamotion/player/file/type-aliases/filesource/): What a load can be given: - [LoadResult](https://player.rupamotion.com/reference/api/rupamotion/player/file/type-aliases/loadresult/): What loadFile resolves to: { file }, the validated file, or { error }. - [MarkupChoice](https://player.rupamotion.com/reference/api/rupamotion/player/file/type-aliases/markupchoice/): What mountFile does with the markup already in the root: - [MountFileResult](https://player.rupamotion.com/reference/api/rupamotion/player/file/type-aliases/mountfileresult/): What mountFile resolves to: { player }, the mounted player, or { error } (the root left as it was). - [loadFile](https://player.rupamotion.com/reference/api/rupamotion/player/file/variables/loadfile/): Loads a .rupaplay file and validates it, without touching the page (to read a file, or check one before mounting it with mountFile). - [mountFile](https://player.rupamotion.com/reference/api/rupamotion/player/file/variables/mountfile/): Loads a .rupaplay file and mounts its player on root: the file's CSS and fonts installed (once per root class, taken away when the last of its players is destroyed), its markup kept or written into root (options.markup, sanitised), then mount. - [Player](https://player.rupamotion.com/reference/api/rupamotion/player/interfaces/player/): A player: it controls the CSS animations of one exported root. - [PlayerData](https://player.rupamotion.com/reference/api/rupamotion/player/interfaces/playerdata/): The table of a flow: its states, triggers and poses, as the export writes it (into the snippet, into .player.json, into a .rupaplay file). - [PlayerEvent](https://player.rupamotion.com/reference/api/rupamotion/player/interfaces/playerevent/): What a player's listener is given. - [@rupamotion/player/react](https://player.rupamotion.com/reference/api/rupamotion/player/react/): @rupamotion/player/react: (a .rupaplay file mounted into a div) and useRupaPlayer(ref, data) (the player on markup written in JSX). - [PlayerView](https://player.rupamotion.com/reference/api/rupamotion/player/react/interfaces/playerview/): What usePlayerState returns: the player, the state that plays and whether it is paused. - [RupaPlayerProps](https://player.rupamotion.com/reference/api/rupamotion/player/react/interfaces/rupaplayerprops/): The props of : the file's, and any prop of the div it renders (className, style, id, …). - [PlayerSource](https://player.rupamotion.com/reference/api/rupamotion/player/react/type-aliases/playersource/): Where usePlayerState reads the player: the ref given to (followed when it is given another player), or a player as it is (what useRupaPlayer returns); null or undefined for none. - [RupaPlayer](https://player.rupamotion.com/reference/api/rupamotion/player/react/variables/rupaplayer/): A div the .rupaplay file src is mounted into, after the render (on a server it renders the div alone). - [usePlayerState](https://player.rupamotion.com/reference/api/rupamotion/player/react/variables/useplayerstate/): The player's state for a UI: the component renders again at each statechange, play and pause of the player. - [useRupaPlayer](https://player.rupamotion.com/reference/api/rupamotion/player/react/variables/userupaplayer/): Mounts the player on the element of ref after the render, for markup written in JSX, and destroys it on unmount. - [MountOptions](https://player.rupamotion.com/reference/api/rupamotion/player/type-aliases/mountoptions/): The options of mount: none yet (the .rupaplay loader's options are MountFileOptions, in /file). - [PlayerDataInput](https://player.rupamotion.com/reference/api/rupamotion/player/type-aliases/playerdatainput/): A table given to mount / useRupaPlayer: a PlayerData, or any object as it comes (imported from the export's .player.json, whose numbers and tuples TypeScript widens, or fetched). - [PlayerEventType](https://player.rupamotion.com/reference/api/rupamotion/player/type-aliases/playereventtype/): The events a Player sends (player.on(type, listener)): - [PlayerLoop](https://player.rupamotion.com/reference/api/rupamotion/player/type-aliases/playerloop/): Where a chain that leads back to one of its clips goes on: [state, ms], that clip's state, at ms since the state began. - [PlayerPose](https://player.rupamotion.com/reference/api/rupamotion/player/type-aliases/playerpose/): The pose a state starts from: [selector, properties]. - [PlayerState](https://player.rupamotion.com/reference/api/rupamotion/player/type-aliases/playerstate/): One state of the table: [name, firstEnd, endless, chain, length, loop?]. - [PlayerTrigger](https://player.rupamotion.com/reference/api/rupamotion/player/type-aliases/playertrigger/): One trigger: [on, selector, state, back]. - [mount](https://player.rupamotion.com/reference/api/rupamotion/player/variables/mount/): Mounts a player on an exported root and returns it (root.rupa holds it too). - [The rupa-player element](https://player.rupamotion.com/reference/rupa-player-element/): Every attribute, property and event of the rupa-player custom element. - [Error codes](https://player.rupamotion.com/reference/error-codes/): The code of every error loadFile and mountFile report, what it means and what to do. - [Browser support](https://player.rupamotion.com/reference/browser-support/): Which browsers each entry of the player supports and what happens when a feature is missing. - [Size](https://player.rupamotion.com/reference/size/): The gzipped size and the limit of each entry of the player, measured at every release. - [Changelog](https://player.rupamotion.com/reference/changelog/): The releases of @rupamotion/player and what each one changed. ## Versions - [v0.1: every page in one Markdown file](https://player.rupamotion.com/llms-full.txt)