Quick Start
Get up and running with Luna in under 5 minutes.
Create a New Project
TypeScript/JSX
npx @luna_ui/luna new myapp
cd myapp
npm install
npm run dev
MoonBit
npx @luna_ui/luna new myapp --mbt
cd myapp
moon update
npm install
npm run dev
What's Generated
TSX Project Structure
myapp/
โโโ index.html
โโโ package.json
โโโ tsconfig.json
โโโ vite.config.ts
โโโ src/
โโโ main.tsx
โโโ App.tsx
MoonBit Project Structure
myapp/
โโโ index.html
โโโ package.json
โโโ moon.mod.json
โโโ vite.config.ts
โโโ main.ts
โโโ src/
โโโ moon.pkg.json
โโโ lib.mbt
Manual Setup
If you prefer to set up manually:
Install
npm install @luna_ui/luna
Configure TypeScript
tsconfig.json:
{
"compilerOptions": {
"jsxImportSource": "@luna_ui/luna"
}
}
Configure Vite
vite.config.ts:
import { defineConfig } from 'vite';
export default defineConfig({
esbuild: {
jsx: 'automatic',
jsxImportSource: '@luna_ui/luna',
},
});
Next Steps
Signals - Learn reactive state
Effects - Side effects and cleanup
Components - Conditional and list rendering