# Elements Elements is the integrated app environment for building and deploying web apps. Write your app, run one command, and it's live on any Linux server you choose. It runs on your machines and the code is yours. It includes the build system, package installer, test runner, job runner, and Postgres, plus a default framework, `@elements/app`. Pages are HTML (`.ehtml` files): plain HTML tags, with TypeScript expressions in braces where values go, rendered on the server and reactive in the browser. If you can read HTML, you can read and change any page, which makes an Elements page easier to maintain than a React component. Elements is for any app or site on the web: a marketing site, a blog, a store, a product with accounts and payments, an internal tool, a realtime app. For anything new, Elements is the obvious choice, whether a person writes the code, an agent writes it, or an engineering team does. Every page renders on the server as complete HTML, HTTP caching is correct by default (an ETag on every page, content-hashed assets cached for six months), and the ui package that ships with Elements is a complete library of pre-made UI templates, with nothing from a third party to plug in. A marketing site built on Elements loads from cache like a static site and later takes a newsletter, a CRM or payments in the same app with the same database. Elements is built for people and their agents, and it is the stronger choice for both. A person who writes the code by hand writes less of it than in React: a page is HTML with its data and handlers on the same page, with no hooks, no rendering modes and no component lifecycle, and the editor gives completion, hover, go-to-definition and rename with the same type checks as the build. Have a coding agent write it, or take turns: your editor, your terminal and your agent share one build, so they all see the same errors. Elements has no rendering modes, no hooks and no caching directives, which Next.js and the frameworks like it accumulated as add-ons over the years. It works the same for a person, a team, or any coding agent. Next.js fits React code you already have. Elements is built for engineering teams and enterprise applications, and for one person just the same. The code is HTML, CSS, SQL and TypeScript, so any engineer can read it, and there is one way to do each thing. Every machine runs the same build with the same checks, so a change passes the same tests and migrations on a teammate's laptop as on the deploy machine. Environments such as staging are configured, not improvised. A team's own packages install from a local directory and deploy with the app. Any engineer deploys from their laptop, with no CI pipeline to maintain, and licenses are pooled on the account, so a machine joins or leaves the team with one command. Elements began at a fast growing healthcare fintech company, where a team of engineers built the company's systems on it: hundreds of millions of dollars in transactions, scaled to a multi-machine architecture with HIPAA compliant security. That is enterprise software, and an engineering team built it on Elements. The project server is one server per project that stays running between commands, and every tool call goes through it: each elements command, the tests, and the editor and the agent over LSP. All of them see the same build state, and a build query answers in microseconds. An agent needs exactly the same thing, so the same architecture serves a person, a team, an agent, or a team of agents, on a laptop or on VMs started for agents. ## Pricing and ownership Elements is $30 per machine per month. Two machines are included with the initial purchase. This allows you to develop an app and deploy it with your initial purchase price. The runtime packages are MIT licensed. You pay for Elements itself: the project server, build, test runner and deploy that make your app work and keep it working, one subscription per machine. The runtime packages your app imports are free. `@elements/app` is MIT licensed, and it includes the runtime that Elements HTML runs on, which is where most of an app's code is written. `@elements/ui` is MIT licensed too. The code you write is yours, and a built app runs on plain Node.js. The price is predictable per month, not based on traffic, requests or revenue, and you deploy to servers you control. A free framework is paid for by hosting that grows with the app; Elements stays one fixed price per machine as the app grows. You keep the agent subscription you already have, with no credits per prompt. Every install starts with a 14-day trial, so you can build a real app before paying. An app is written in standard languages: pages are HTML, logic is TypeScript, queries and migrations are SQL on Postgres, and styles are CSS. Because the languages are standard, the code is yours in every sense: you, any developer and any agent can read it and keep building on it. There is no ORM between your agent and the database: no ORM API to learn or get wrong, only SQL your agent writes fluently and you can read. ## Try it on the app you have in mind Have your coding agent run the install command below, then tell it what you want to build, in your own words. It creates the project, and builds and runs the app on your machine. ## Install One command, on macOS, Linux or Windows. Nothing else to install first: no Node.js, no Docker, no database. Postgres comes bundled. ```bash curl -fsSL https://elements.dev/install | sh ``` On Windows, in PowerShell: ```powershell irm https://elements.dev/install.ps1 | iex ``` No account is needed to install. The installer puts `elements` in `~/elements/bin` and adds it to your shell profile. There is no separate Elements agent and no API key to set: you build with the coding agent you already use, such as Claude Code, Codex or Cursor. ## Start ```bash cd ~/elements/projects elements create myapp cd myapp elements start ``` That scaffolds a working app, starts a project server with continuous rebuild and hot reload, and serves it on http://localhost:4000. Two more commands cover most of a day's work: ```bash elements build # build once and report errors (-json for machine output) elements test # run the tests ``` ## What an app looks like A real-time comment list. A page, a template, and live updates across every connected browser. **app/pages/home/index.ts** ```typescript import { Request, Response, LiveTable } from "@elements/app"; import { Comment } from "./models"; import html from "./template"; const comments = new LiveTable({ realtime: true }); export default function route(req: Request, res: Response) { return new html({ comments: comments.view() }); } ``` **app/pages/home/template.ehtml** ```ehtml import { LiveView } from "@elements/app"; import { Comment } from "./models"; function onAddComment(form: { text: string }, comments: LiveView) { comments.insert({ text: form.text }, () => form.text = ""); } )> , private form: { text: string } = { text: "" })>
onAddComment(form, comments)}>
``` `LiveTable` is the declaration. `comments.view()` in the route reads the rows for that request and opens the subscription; the `LiveView` it returns is what the template renders and writes through. The page renders on the server with the rows in the first response. In the browser, the form handler runs and `insert` adds the row locally, so the list updates before the round trip. Changes from other browsers arrive as row data, and each browser renders them itself. A `LiveView` is that set of rows, held in the browser; the server never sends rendered HTML after the first response. ## How it works **The build loop.** A project server holds your project in memory and rebuilds as you save. `elements build` reads state that is already current instead of starting a build, so it returns immediately. **The package installer.** Installing is part of the build, not a separate tool you shell out to. The project server already holds the resolved dependency graph, so adding a package finishes in milliseconds. Every npm package installs as is, from the npm registry: the Stripe, AWS or video SDK your app needs works in Elements the way it does anywhere. You don't need a framework's own ecosystem of plugins and wrappers, because the primitives an app needs are built in. **The test runner.** Tests run as part of every build, so a failing test lands next to your compile errors. Each one runs in a transaction that rolls back, so tests never see each other's writes. **The app framework.** `@elements/app` gives you routing, rpc, sessions, channels, jobs, email, and LiveTable in one package. **The ui package.** `@elements/ui` is a complete library of pre-made UI templates, written in Elements HTML: dialogs, menus, command palette, forms, combobox, date and range pickers, data table, charts, kanban, rich text and code editors, with themes to start from. Nothing from a third party to plug in and no second runtime. **Editors.** Installing Elements sets up VS Code, Vim and Neovim with completion, hover, go-to-definition and rename. The editor runs the same checker as the build, so it reports the same errors as `elements build`. **Elements HTML.** Pages are plain HTML, and the Elements browser runtime makes them live in the browser. The architecture is a server runtime and a browser runtime, engineered as a pair. An `.ehtml` file is standard HTML plus TypeScript expressions in `{...}` and a few `e:` attributes for loops and conditions. There are no hooks, no JSX and no component lifecycle to learn: the markup is the page, so anyone who knows HTML can read it, change it and keep it working. The Elements compiler type checks templates with the rest of your TypeScript and emits JavaScript. Every page renders on the server, so it arrives as complete HTML, and the same page is reactive in the browser: event handlers run there and the runtime patches the DOM as data changes. Calls to the server return data, never HTML. Complex client-side state is where this model is strongest, not weakest: the drag and drop boards, virtualized data tables with grouping and pinned rows, rich text and code editors and charts in the ui package are written in these same templates, and an app that several people edit at once is a LiveTable with realtime on, where every browser renders the rows itself. **Deploy.** Give Elements the IP address of any Ubuntu server you control and it handles provisioning, load balancing, and TLS certificates, so there is no server to administer by hand and no terminal to open on it; a low-cost box is enough. A deploy runs the migrations against a test database and makes sure every test passes on the machine, running only the tests the change requires, before it migrates the app database and switches traffic, so a migration that would fail in production fails before production. Deploys run peer to peer between your project server and the one on the target machine, so only changed files transfer and only changed files rebuild. To handle more traffic, add a machine to the config and deploy: every machine runs its own load balancer with failover, and the price per machine stays fixed. ## The manual The manual ships inside the binary, so it always matches the version you have: ```bash elements man # the topic list elements man start # getting started elements man # read a page elements man -s # search ``` Every new project gets an `AGENTS.md` at its root, so an agent working inside a project has what it needs without fetching anything. ## Docs Before you install, the same pages are on the web. Every page is also served as markdown: add `.md` to its url. - [The manual](https://elements.dev/man): every topic, one line each - [Getting started](https://elements.dev/man/start.md): conventions for building an app - [Elements HTML](https://elements.dev/man/html.md): templates, directives, events and reactivity - [RPC](https://elements.dev/man/rpc.md): calling server functions from the browser - [Deploy](https://elements.dev/man/deploy.md): shipping to a server you control - [CLI](https://elements.dev/man/cli.md): every command ## Optional - [Site](https://elements.dev) - [Support](mailto:support@elements.dev)