Install with Vite
Vite is a build tool, not a framework: an application built with it alone has no routing and no server rendering. React recommends starting new applications with a framework; use this guide when a client-only application is what you want. Follow Vite’s current requirements for your Node.js runtime.
1. Create the application with LoamUI
pnpm dlx loamui@latest create --framework vitenpx loamui@latest create --framework viteyarn dlx loamui@latest create --framework vitebunx loamui@latest create --framework viteThis runs create vite with the React and TypeScript template, installs @loamui/core, replaces the template’s src/index.css — an unlayered reset — with the layer order, writes the welcome component and points src/App.tsx at it, and then runs init: the stylesheet link in index.html, Stylelint, Oxlint and Oxfmt with the composition checker and a check script, a LoamUI section in AGENTS.md, and the agent skills. Give the directory after create, or answer the prompt.
Already have an application? Run init in it instead:
pnpm dlx loamui@latest initnpx loamui@latest inityarn dlx loamui@latest initbunx loamui@latest initinit only adds — nothing you have is replaced — and running it again changes nothing; --dry-run shows the plan. It puts the layer order at the top of src/index.css, keeping your rules, adds the stylesheet link to index.html, and adds the checks, scripts and skills. Follow the existing-project workflow before changing its styling foundation.
2. Check your first interface
create wrote src/components/Welcome.tsx with welcome.css beside it and rendered it from src/App.tsx; in an existing application, copy the foundation example there and omit "use client", which has no meaning here.
pnpm run devnpm run devyarn run devbun run devCheck the interface, then stop the server and verify the production build:
pnpm run buildpnpm run preview
npm run buildnpm run preview
yarn run buildyarn run preview
bun run buildbun run preview
Once the foundation works, build with the skill.
What create and init did, by hand
The same setup by hand
Create a React and TypeScript project:
pnpm create vite@latest my-app --template react-tscd my-app
npm create vite@latest my-app -- --template react-tscd my-app
yarn create vite my-app --template react-tscd my-app
bun create vite my-app --template react-tscd my-app
Install the package:
pnpm add @loamui/corenpm install @loamui/coreyarn add @loamui/corebun add @loamui/coreLink the stylesheet
Add the core stylesheet to the <head> of index.html, before the application’s script:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@loamui/core@0.2.0/dist/styles.css" />The browser loads tokens, element styles and component styles without sending core CSS through Vite, which avoids a parsing limitation in Lightning CSS. Do not add a JavaScript import or CSS @import of @loamui/core/styles.css. No provider is needed.
The URL is pinned to the installed version of @loamui/core; keep the two in step when you update. See stylesheet delivery for self-hosting.
Declare the layer order
Start src/index.css with the layer order, before any imports or rules that create LoamUI layers; src/main.tsx already imports it:
@layer loamui.tokens, loamui.elements, loamui.components;For a fresh application, replace the template’s styles with that declaration: they are an unlayered reset, and an unlayered rule overrides LoamUI’s element styles. Preserve existing application styles when integrating into a working project. Import recipe styles alongside their components.
The checks, scripts and skills are described in Build with the skill.