# toonstrip documentation --- # Getting started > Drop in a script tag and a custom element, render your first strip. Source: https://toonstrip.danielkimdev.com/docs/getting-started/ toonstrip renders a comic strip from data you supply. There is nothing to generate and no image pipeline: you write a small JSON document, the page draws it on canvases. This page gets you from an empty HTML file to a rendered panel, no install and no build step. ## 1. Add the element `@toonstrip/element` is a custom element with no framework dependency. [esm.sh](https://esm.sh) resolves it and its dependencies for you, straight from a ` ``` Pin the exact version, same as any other dependency. ## 2. Point it at a pack The default pack is the fifteen-character Comic Chat roster with three backdrops. unpkg serves a pack's files (`pack.json`, sprite sheets, backdrops) as-is, with CORS enabled, so there is nothing to copy anywhere: ```js strip.packs = ["https://unpkg.com/@toonstrip/pack-comic-chat@0.1.1/"]; ``` ## 3. Render a strip Put a `` tag in the page and set its `document` property. ```html ``` (Example strip `firstStrip` — see https://toonstrip.danielkimdev.com/docs/getting-started/ for the rendered version.) That is the whole embed: a script tag, a pack URL, and a document. Save it as `index.html` and open it, no server required. `npm install @toonstrip/element @toonstrip/pack-comic-chat` works too, but a bare `import "@toonstrip/element"` only resolves in a browser through a bundler or an import map — a plain ` ``` ## API | Member | Type | Meaning | |---|---|---| | `packs` | `string[]` property | Base URLs of asset packs, each serving `pack.json` and its files. Searched in order; duplicate ids across packs throw. | | `document` | `ComicStripDocument` property | The strip. Validated on set. Setting it again re-renders. | | `columns` | `number` getter | Column count from the last layout pass. | Setting `document` before `packs` is fine; the element rebuilds on either change and the last set wins. Validation errors and unknown ids are reported by replacing the strip with a short red notice and logging to the console. Nothing throws out of a property setter. ## From a framework React, Vue, Svelte, and the rest can all render a custom element and set properties on it. The one thing to remember is that `packs` and `document` are **properties**, not attributes: set them from a ref after mount, or use your framework's property-binding syntax (`.document={doc}` in Lit, `prop:document={doc}` in Solid, `:document.prop` in Vue). For React and Vue specifically, `@toonstrip/react` and `@toonstrip/vue` package exactly this pattern as a `` component. See [React reference](/docs/react-reference/) and [Vue reference](/docs/vue-reference/). ## Bundling The element imports `@toonstrip/core` and `@toonstrip/schema`; any ESM bundler handles it. The schema is embedded at build time as plain data, and validation runs as ordinary JS with no `eval`, so a strict Content Security Policy does not need `unsafe-eval`. ## No build step at all The `install`/`npm`/bundler steps above assume *something* resolves the bare `import "@toonstrip/element"` specifier. With no bundler and no import map, use [esm.sh](https://esm.sh) instead, which resolves a package's own dependencies for you: ```html ``` Point `packs` at a CDN too: unpkg serves a pack's static files (`pack.json`, sprite sheets, backdrops) as-is, with CORS enabled: ```js strip.packs = ["https://unpkg.com/@toonstrip/pack-comic-chat@0.1.1/"]; ``` The full worked example is `examples/vanilla-html/index.html` in the repo: one file, no `package.json`, opens from `file://` or any static file server. Pin exact versions in both URLs, same as any other dependency. See the repo's `docs/vanilla-html.md` for the esm.sh-vs-unpkg reasoning in full. --- # Astro reference > Every option of the integration and the component, and the current limitations. Source: https://toonstrip.danielkimdev.com/docs/astro-reference/ ## `toonstrip(options)` The integration, added to `integrations` in `astro.config.mjs`. | Option | Type | Meaning | |---|---|---| | `packs` | `string[]` | npm specifiers of asset packs to serve. Each is resolved, and its `pack.json`, `characters/`, and `backdrops/` are copied to `public/_toonstrip//` during `astro:config:setup`. Default: none. | The integration also registers a renderer for ``. The server half emits an inert `` tag; the client half imports `@toonstrip/element` and sets the properties. Nothing else touches your Vite config. ## `` ```astro --- --- ``` | Prop | Type | Meaning | |---|---|---| | `document` | `ComicStripDocument` | The strip. Any object of the right shape; usually an imported JSON file. | | `packs` | `string[]` | Pack **names** (the `name` field of each `pack.json`), resolved to `/_toonstrip//`. Default `[]`, which renders nothing useful, so always pass at least one. | Any Astro client directive works. `client:visible` is the documented default; use `client:load` above the fold and `client:idle` for a strip near the top that is not the first thing the reader needs. ## What renders on the server Only the tag. There is no server-side canvas in the component, so there is no content without JavaScript beyond the element's `aria-label`s, which are generated client-side too. For a static image (Open Graph, RSS, a `