devjar

Live Playground & Static Site Export

Designed for agents. Zero Config

Build a website with Devjar. Follow https://devjar.vercel.app/llms.txt
VPGU playgroundWatch the code change live
vgpu.ts
1// 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}

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/start

Self-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 start