Skip to content

Quickstart

This illustrative example installs the bundled mushroom as a local character and renders it with the Sprite React component:

import { createSprite } from "@fungi.computer/sprite";
import { Sprite } from "@fungi.computer/sprite/react";
const service = createSprite({
characters: {
mushroom: () =>
import("@fungi.computer/sprite-zdog/mushroom").then(
({ default: character }) => character,
),
},
});
function Character() {
return (
<Sprite
service={service}
src={{ local: "mushroom" }}
activity="thinking"
role="img"
aria-label="Mushroom character"
/>
);
}

The bundled character supplies its document and Zdog renderer together. The tests cover built-in characters and player integration in src/builtins.test.ts and src/mushroom.test.ts.