Installation
Pick your package manager and install Ignite Element with a state adapter:
pnpm add ignite-element xstate# pnpm add ignite-element @reduxjs/toolkit # Redux# pnpm add ignite-element mobx # MobX1) Configure JSX (Ignite JSX renderer)
Section titled “1) Configure JSX (Ignite JSX renderer)”Add the Ignite JSX runtime to your tsconfig.json (or use a file-level pragma):
{ "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "ignite-element/jsx" }}2) Add ignite.config.ts
Section titled “2) Add ignite.config.ts”Centralize renderer defaults, logging, and global styles:
import { defineIgniteConfig } from 'ignite-element/config';
export default defineIgniteConfig({ renderer: 'ignite-jsx', // or "lit" styles: new URL('./src/styles.css', import.meta.url).href, logging: 'warn',});3) Wire your bundler
Section titled “3) Wire your bundler”- Vite: add the plugin.
import { defineConfig } from 'vite';import { igniteConfigVitePlugin } from 'ignite-element/config/vite';
export default defineConfig({ plugins: [igniteConfigVitePlugin()],});- Webpack: use the provided plugin.
const { IgniteConfigWebpackPlugin } = require('ignite-element/config/webpack');
module.exports = { plugins: [new IgniteConfigWebpackPlugin()],};4) Optional: lit renderer
Section titled “4) Optional: lit renderer”If you prefer lit templates, install lit-html and set renderer: "lit" in ignite.config.ts. Keep the bundler plugins from step 3; they load your config and renderer entrypoint.
Runtime dependencies and tree shaking
Section titled “Runtime dependencies and tree shaking”Ignite Element stays lean but is not literally “zero dependency”: you must install the state library you choose (XState, Redux Toolkit, or MobX). Ignite JSX uses a minimal custom renderer (no framework runtime). If you opt into the lit renderer, install lit-html. Import from the adapter entry point that matches your state library (ignite-element/xstate, ignite-element/redux, or ignite-element/mobx) so only the renderer and adapter you pick are pulled into your bundle and unused adapters are tree-shaken.
Verify your setup
Section titled “Verify your setup”- Run a TypeScript check (e.g.,
pnpm exec tsc --noEmitornpx tsc --noEmit) to ensure JSX settings work. - Create a smoke test component via Your first component.
- Keep the
ignite.config.tsimport near your app entry if you are not using the bundler plugins.