devjar
Live Playground & Static Site Export
Designed for agents. Zero Config
Build a website with Devjar. Follow https://devjar.vercel.app/llms.txtnpm install devjarnpx devjar dev1// Warm — change a number to reshape the light.2export const appearance = {3 speed: 0.35, // 0 freezes time.4 scale: 2.4, // Zoom into the pattern.5 warp: 1.2, // Twist the flowing bands.6 hue: 0.15, // Try 0.6 for a new palette.7 bands: 3, // More bands, finer ribbons.8}Gallery
See the code change as you scroll. Make it your own in the editor.
Drum machine
1// 1 = hit, 0 = rest. Each group is one beat.2// Rows: kick, snare, hi-hat, clap.3export default [4 [1,0,0,0, 0,0,1,0, 1,0,0,0, 0,0,0,0],5 [0,0,0,0, 1,0,0,0, 0,0,0,0, 1,0,0,0],6 [1,0,1,0, 1,0,1,0, 1,0,1,0, 1,0,1,1],7 [0,0,0,0, 0,0,0,0, 0,0,0,0, 1,0,0,0],8]CMS example
1{2 "name": "devjar",3 "tagline": "Make an idea real. Change it live.",4 "category": "Features",5 "title": "Your next idea, already live.",6 "description": "Write React pages, edit their content, and see your changes in the preview. Start with an idea and keep going.",7 "about": "Devjar is a zero-config React static site builder. Create pages with React and TypeScript, share components between routes, and build a static site from the same files.",8 "entries": [9 {10 "title": "See changes as you make them",11 "category": "Live updates",12 "step": "01"13 },14 {15 "title": "One file. Another page.",16 "category": "File-based routing",17 "step": "02"18 },19 {20 "title": "Build a site you can take anywhere",21 "category": "Static output",22 "step": "03"23 }24 ]25}26Cards in a jar · React Three Fiber
1[2 { "design": "code", "color": "#eee2ca", "width": 0.54, "height": 0.76, "x": -0.24, "z": -0.12, "tilt": 0.18 },3 { "design": "lines", "color": "#f3e8d4", "width": 0.58, "height": 0.84, "x": 0.32, "z": -0.08, "tilt": -0.16 },4 { "design": "dots", "color": "#f4ead8", "width": 0.46, "height": 0.52, "x": -0.43, "z": 0.27, "tilt": 0.12 },5 { "design": "line", "color": "#272b28", "width": 0.34, "height": 0.56, "x": 0.12, "z": 0.32, "tilt": -0.06 }6]Live code APIs
Build your own editor, interactive docs, or shader playground with live React previews.
Render a project with DevJar
All four gallery demos use the DevJar component. Pass project files as strings, connect your editor to the files prop, and watch changes run inside an iframe. Use useDevJar to control your own iframe.
import { DevJar } from 'devjar'const files = { 'pages/index.tsx': `export default function Page() { return <h1>Hello from devjar</h1> }`,}function Preview() { return ( <DevJar files={files} title="Live preview" /> )}Embedded previews run in the browser. No special hosting headers required.
For a live code editor, pair Devjar with @sugar-high/react. Its Editor component provides syntax highlighting; update files from its onChange callback to refresh the preview. The gallery demos use this combination.
Personal website example: live playground to static export →
Read the component and iframe documentation →Advanced API: control your own iframe
Use DevJar for managed previews. The advanced useDevJar hook lets you own the iframe and decide when a project runs.
import { useDevJar } from 'devjar'function Preview({ files }) { const { ref, load, error } = useDevJar({ tailwind: false }) return ( <> <button onClick={() => void load(files)}>Run</button> {error != null && <pre>{String(error)}</pre>} <iframe ref={ref} title="Live preview" /> </> )}CLI: build a site without the setup
Devjar keeps the project structure simple and handles the production details for you.
Routes from files
Files inside pages/ become routes, including nested pages and a custom 404.
An optional package.json pins dependency versions. Packages load from the CDN, so you don’t need to install them.
package.json # optional: dependency versionspages/├── index.tsx → /├── about.tsx → /about└── docs/ └── start.tsx → /docs/startSelf-contained production builds
Routes are prerendered to HTML. Dependencies are vendored, and imported assets and Tailwind CSS are emitted with content hashes.
Three commands
Develop locally, create the static output, then preview exactly what you will deploy.
npx devjar devnpx devjar buildnpx devjar startReady for any static host
Deploy the generated files at the domain root or use --base for a subdirectory.