Elements vs Astro
Astro is an open-source web framework for content-driven websites such as blogs, marketing sites and documentation (why Astro (opens in a new tab)). It is free and MIT-licensed, and it is made by The Astro Technology Company, which joined Cloudflare (opens in a new tab) in January 2026. Cloudflare sells hosting, including Workers, metered by requests and CPU time (Workers pricing (opens in a new tab)). Pages are .astro files: HTML with a component script at the top that runs on the server. By default, Astro prerenders each page to static HTML at build time and sends no JavaScript to the browser. Interactive parts are islands: components written in React, Vue, Svelte or another UI framework, each loaded in the browser with a client: directive. Astro routes by the files in src/pages/, loads Markdown and MDX through content collections, and with a server adapter can render pages on demand.
Elements also starts from HTML. It is an integrated app environment, built for people and their agents. A project server runs while you work. The same system includes a package installer, a test runner, a bundled Postgres database and a deploy command for any Ubuntu server you reach over SSH. It ships with a default framework that just works, whose pages are Elements HTML, standard HTML with reactive expressions, rendered on the server for every request. Typed server functions, sessions, realtime data, background jobs and email are part of it. Elements apps are written in TypeScript and run on Node.js.
Astro is a set of parts you assemble. Sign-in, a database, realtime updates, background jobs, email and tests are not in Astro, so each one is a library or a service you pick and connect, and every seam between them is a place the app breaks, for a person or an agent. Even rendering is a choice: static by default, and on demand only once you add an adapter for your host. Elements is ready out of the box: sessions, Postgres, jobs, email and tests are in place when elements create makes the app. It stays close to the metal, with HTML, CSS, TypeScript, SQL and function calls, and the framework vocabulary is the bare minimum: app.route(), session.login(), sql(), @rpc and tests. A blog, a marketing site and a product with accounts, payments and realtime are the same kind of app, built, tested and deployed by the same system.
For anything new, Elements is the obvious choice, a marketing site included. Astro makes sense only for a site already built on it, to keep the React, Vue or Svelte code it has.
At a Glance
| Elements | Astro | |
|---|---|---|
| What it is | A project server, a default framework, Postgres, tests and deploy, shipped as one coherent system | A framework for content-driven websites, with adapters for each host |
| Business model | Sells the system you build with, per machine, with nothing metered (pricing (opens in a new tab)) | Owned by Cloudflare, which sells metered hosting (Cloudflare (opens in a new tab), Workers pricing (opens in a new tab)) |
| Rendering | On the server (opens in a new tab), with the page's data in the first response | Prerendered to static HTML by default; on demand only with an adapter |
| Interactive parts | Any template, written in Elements HTML (opens in a new tab) like the rest of the page | Islands, each in a UI framework of its own, sharing state through a separate library |
| UI templates | A complete library of pre-made UI templates ships in the ui package, written in Elements HTML, with themes | None of its own; islands bring a React, Vue or Svelte library and its runtime |
| Caching | Correct by default: an ETag on every page, content-hashed assets cached for six months, and one header to cache a page longer | Static files, cached by the host; an on-demand page is cached however the adapter and host decide |
| Hosting cost | One low-cost server, at a fixed price per machine; a CDN is one config setting | Free static hosting until a host's usage tiers apply; on-demand pages run on the host's metered runtime |
| Content | Rows in Postgres, live on the next request | Markdown and MDX files through content collections; a prerendered page changes after a rebuild and redeploy |
| Routing | Declared in code (opens in a new tab) with web standard URLPattern |
Files in src/pages/ |
| Server functions | @rpc (opens in a new tab): import the function and call it, typed end to end |
Actions, with input validated by Zod schemas |
| Sign-in and sessions | Built in (opens in a new tab), the same over HTTP and WebSockets | No official sign-in; sessions need on-demand rendering and a storage driver |
| Database | Postgres, bundled (opens in a new tab), with sql() and migrations (opens in a new tab) |
Not included; the docs recommend a third-party library |
| Payments | Stripe Checkout (opens in a new tab), set up with one secret key | Not included |
| Realtime | LiveTable (opens in a new tab) and channels (opens in a new tab) | Not included |
| Background jobs and cron | Built in (opens in a new tab) | Not included |
| Built in (opens in a new tab), written in Elements HTML | Not included | |
| Tests | Part of the build (opens in a new tab) | Not included; the docs cover four outside tools |
| Build errors | One build (opens in a new tab) reports type checking, tests, migrations and program analysis, as you work | astro check, a separate command the docs aim at CI; tests are a tool you add |
| Deploy | elements deploy (opens in a new tab) to any Ubuntu server over SSH, often under a second |
Static files to a host, or an adapter per host, each configured on its own |
One Language for Every Part of a Page
Each interactive part of an Astro page is an island, and each island can be written in a different UI framework: a React search box, a Vue cart and a Svelte carousel can ship on the same page, and each framework loads its own runtime in the browser. That is one more decision per island, and one more seam: islands cannot share state through a framework's context providers, so Astro's docs send you to a separate library, Nano Stores, to pass it between them (sharing state (opens in a new tab)).
In Elements, the static parts and the interactive parts of a page are written in the same language. Elements HTML (opens in a new tab) is standard HTML plus TypeScript expressions in {} and a few e: attributes for conditions and loops, and any template can bind a form field, call the server or show live data. A search box that filters a list as you type is one template, with no island:
app/pages/search/template.ehtmlinterface Post { slug: string; title: string; } function matches(post: Post, text: string): boolean { return post.title.toLowerCase().includes(text.toLowerCase()); } <html (posts: Post[], private search: { text: string } = { text: "" })> <input type="search" value={search.text} placeholder="Search posts"> <ul> <li e:for={post of posts.filter((p) => matches(p, search.text))}> <a href={"/blog/" + post.slug}>{post.title}</a> </li> </ul> </html>
The input binds both ways by default, so typing updates search.text and the list updates with it. The page still renders on the server, with the full list in the first response.
Agents Need Correction, Not Endless Abstractions
For an AI coding agent such as Claude Code or Codex, the value is not in endless framework abstractions or in a directory of integrations. It is in correction: finding out what it got wrong the moment it gets it wrong. Astro's pitch leans the other way, on its integrations directory (opens in a new tab) and on islands in any UI framework. An integration helps an agent only when it does something the agent cannot write quickly from standards, and that set is small. To draw a search box, an agent would sooner write HTML and CSS than pick between React, Vue and Svelte and learn the island directives that load them, and a few lines of TypeScript beat adding a package. Every integration past that point is one more config entry, one more API to look up, and one more seam between parts that were not built together.
Some framework is worth having. No agent writes machine code to build a site, and none wants a package to subtract two numbers; between those ends is the plumbing every app needs, and the Elements app framework ships it: routing, typed server calls with @rpc, sessions, sql() and the database driver. Each abstraction past that costs an agent more to learn and get right than it saves, so past the plumbing Elements stays with standards: a page is HTML and CSS, an interactive part of it is the same HTML with TypeScript in braces, a server call is a TypeScript function call, and data is SQL through sql().
The engineering goes into correction. The framework and its build were designed together, so one coherent system checks every page, server function, sql() call, migration and test the agent writes, and elements build -json reports each mistake in microseconds, because the project server already holds the build state. Your terminal, your editor and each agent read that same build. Server code is written without async or await (async (opens in a new tab)), so no agent can forget an await.
Content Goes Live Without a Rebuild
A prerendered Astro page changes only when the site is rebuilt and redeployed. Content that has to change between builds needs pages rendered on demand, which takes a server adapter (opens in a new tab) for your host, or content loaded at request time.
In Elements, content is data in Postgres, and every page renders on the server (opens in a new tab) with its data already in the first response. Search engines and first-time visitors get complete HTML, and a page with no event handlers works with JavaScript turned off (marketing page (opens in a new tab)). The markdown blog recipe (opens in a new tab) stores posts as rows, renders their Markdown to HTML on the server with an npm package, and gives admins an editor page in the same app. A draft is a row with no publish date. Publishing sets one, and the post is live on the next request, with no rebuild and no deploy. The same tables feed search, feeds and anything else the app builds on them.
A Static Site Is a Cached Dynamic Site
The case for a static site generator is speed and cost: a prerendered file is served from a cache, so no server renders it per visit. HTTP caching gives a dynamic site the same result, and Elements sets it up correctly by default (server rendering (opens in a new tab)). Every page response carries an ETag computed from the page, its data and the session. A return visit sends the ETag back, and an unchanged page answers 304 with no body, so the browser shows the copy it already has. Every asset URL is content-hashed and served with a six-month immutable cache, so stylesheets, scripts and images load from the browser's memory on every visit after the first. A page that changes rarely can be cached outright: a route sets Cache-Control to keep the page in cache for a month, and Elements honors it. The same resolver keeps a signed-in page or a page with live data private and revalidated no matter what the route asks for, so a cache header can never leak one visitor's page to another. A CDN in front of it all is one config setting (CDN (opens in a new tab)).
With those headers, the difference between a static page and a dynamic one is close to zero, and the dynamic page is still a page in an app. A static site generator is a particular way of building that stops working the day the site needs a signup form that writes to a database, a signed-in area or a page that differs per visitor. Build the site correctly from the start, and let it be static in effect for as long as it wants to be.
Faster First Paint Than a React Island
An Elements page is complete HTML in the first response, with its data already in it, because server rendering is how Elements HTML is designed, not a mode to turn on (server rendering (opens in a new tab)). A search engine, a social preview and a visitor on a slow connection all get the finished page. The browser runtime that makes the page reactive is smaller than React, and a page with no event handlers works with JavaScript turned off (marketing page (opens in a new tab)). An Astro island brings its framework's runtime with it, and a page with a React search box, a Vue cart and a Svelte carousel brings three.
The UI Templates, Built In
Astro has no templates of its own. An interactive part of the page is an island, and an island is a component from a React, Vue or Svelte library, loaded with that framework's runtime. The ui package that ships with Elements is a complete library of pre-made UI templates, written in Elements HTML: dialogs, menus, command palette, forms and fields, combobox, date and range pickers, data table with sorting, filtering and live rows, charts, kanban, rich text and code editors, and themes to start from. Nothing from a third party to plug in, no runtime to add, and the same language as the rest of the page.
The Site Grows Into the Product
A site rarely stays a site. A marketing page gains a signup form, then paid plans, then a dashboard, notifications and a nightly report. In Astro, each of those is a decision to make and a part to connect before it works:
- Sign-in: "There is no official authentication solution for Astro," say its docs (opens in a new tab), which send you to the integrations directory and walk through four options: Better Auth, Clerk, Lucia and Scalekit.
- Sessions: only for pages rendered on demand, and they need a storage driver. The Node, Cloudflare and Netlify adapters set a default one, and every other adapter needs one configured (sessions (opens in a new tab)).
- Database: none of its own. The Astro DB (opens in a new tab) page now recommends "migrating to a third-party library", which is one more client, one more schema tool and one more service to provision.
- Payments, realtime, background jobs and email: not part of Astro.
- Tests: not part of Astro. The testing guide (opens in a new tab) covers setting up Vitest, Playwright, Cypress or Nightwatch.
In Elements, each of those is part of the framework. Sessions (opens in a new tab) work in route handlers, server functions and templates, and password sign-in is a short server function that checks a bcrypt hash in Postgres (authentication (opens in a new tab)). Card payments go through Stripe Checkout, and your part of the setup is one Stripe secret key (payments (opens in a new tab)). A LiveTable (opens in a new tab) keeps a set of database rows in sync in every browser showing it. Jobs and cron (opens in a new tab) run from a queue in the same Postgres database, and email (opens in a new tab) is written in the same html language as pages and sent through any SMTP provider you configure.
The marketing page and the dashboard share one layout, one stylesheet, one set of types and one deploy.
One Answer for Every Check
Astro's astro dev --background runs the dev server in the background with JSON logs, and starts it that way automatically when it detects an AI agent on macOS or Linux. The dev server does no type checking. astro check does that separately, and the CLI reference (opens in a new tab) says it "is intended to be used in CI workflows." Tests are a separate tool you choose, configure and run yourself. A build can also pass when content is broken: "glob() loader seems to swallow Markdown rendering errors and lets astro build exit successfully (opens in a new tab)" is open, marked "P4: important."
Elements gives you every check in one answer, as you work. A project server runs while you work and holds the build graph and build state in memory. On every save, the build state is updated almost instantly, and it builds in milliseconds and answers agents and humans in microseconds (build (opens in a new tab)). Ask elements build -json and the reply covers every build error at once, type checking, tests, migrations and program analysis, for code and templates alike, whether the asker is your editor, your terminal or one of several agents.
Deploys Often Finish in Under a Second
A static Astro site is rebuilt with astro build and its output uploaded to a host. A site with pages rendered on demand needs an adapter for that host, its database is another service you provision, and tests are a step you add to your own CI. The adapter is a seam of its own. "@astrojs/vercel: the /_astro/* immutable cache rule sits after { "handle": "filesystem" }, so hashed assets are served with max-age=0 (opens in a new tab)" is open: on a Vercel deployment with server output, the adapter's cache rule never runs, and content-hashed files go out with max-age=0.
With Elements, there is no static upload versus adapter decision, and no adapter to match to a host. You rent an Ubuntu server from any provider and point elements deploy at it over SSH (opens in a new tab). Your local project server and the one on that machine work out which files differ and move only those, so a new server takes a few seconds and a routine deploy often less than one. Tests run on each machine before the switch and migrations run once; if either fails, visitors keep getting the release already up. Elements installs Postgres on the server, with the load balancer and TLS certificates. Elements scales across machines by default: one machine is already a complete deployment, and for several, set DB_HOST on every machine to one Postgres, whether a server you maintain or a managed one such as DigitalOcean Managed PostgreSQL or Amazon RDS (setup (opens in a new tab)).
Who Pays for Astro
Astro is an on-ramp to the business of the company that pays for it, and both companies that have paid for it steered the framework toward what they sell. The Astro Technology Company was venture-backed from its start in 2022 (announcement (opens in a new tab)). In March 2024 it launched Astro DB with Astro Studio, a hosted database platform (Astro DB (opens in a new tab)). Six months later it shut Studio down, writing that its goal "to build this into a profitable business to support the continued development and growth of Astro" had failed. Studio databases became inaccessible on March 1, 2025, and were deleted after that (Goodbye Studio (opens in a new tab)). The Astro DB integration that remained was then deprecated and removed from the framework.
In January 2026, the company joined Cloudflare, and its full-time employees became Cloudflare employees (Cloudflare (opens in a new tab)). Cloudflare sells hosting, metered by requests and CPU time (Workers pricing (opens in a new tab)). Cloudflare says Astro will deploy anywhere. Astro 6 rebuilt the Cloudflare adapter so development, prerendering and production all run on Cloudflare's runtime, with the stated goal of making "Cloudflare a first-class Astro runtime" (Astro 6.0 (opens in a new tab)).
Elements earns from one thing, its tooling, sold per machine with nothing metered (pricing (opens in a new tab)), and you deploy to any server you choose. The framework is not on the invoice: @elements/app and its sibling runtime packages carry the MIT license, and every site and app built on them belongs to you (licenses (opens in a new tab)).
Moving From Astro
An agent can port an Astro site easily, because its pages, components and server code map onto the Elements app framework's routes (opens in a new tab), HTML templates (opens in a new tab) and @rpc (opens in a new tab) functions. You keep TypeScript, your Markdown and your npm packages, and you gain sign-in, a database, payments, tests and deploy in the same app, so the site grows into a product.
Questions
What is the difference between Elements and Astro?
Astro is an open-source framework for content-driven websites: pages are prerendered to static HTML by default, interactive islands are written in other UI frameworks, and sign-in, a database, tests and hosting are parts you choose and connect. Elements is an integrated app environment that is ready out of the box: a project server, a default framework with sessions, payments, realtime and jobs, a bundled Postgres database, a test runner and a deploy command, so a site grows into a product in one app.
Is Elements a good fit for a marketing website?
Yes, and for a new one it is the obvious choice. Every page renders on the server as complete HTML, pages carry an ETag and assets are cached for six months, so the site loads from cache like a static one. It deploys to one low-cost server with a CDN as a config setting, and the same app later takes a newsletter, a CRM or payments with no second system.
When should I use Astro instead of Elements?
Only for a site already built on Astro, to keep the React, Vue or Svelte code it has. For anything new, Elements is the obvious choice.
Is Elements an Astro alternative?
Yes. Elements renders every page on the server, and the same app has sign-in, a database, payments, realtime and background jobs, so a site grows into a product without a second framework, build or deploy.
Can I use React, Vue or Svelte components in Elements?
No. Every part of an Elements page, static or interactive, is written in Elements HTML, standard HTML with typed reactive expressions. There is one runtime and one state model, with no islands to coordinate and no state library to add between them.
Who owns Astro?
Cloudflare. The Astro Technology Company, which makes Astro, joined Cloudflare in January 2026, and its full-time employees now work for Cloudflare (Cloudflare (opens in a new tab)). Cloudflare earns its revenue from hosting and network services. Elements is sold directly, per machine, so its revenue comes from Elements itself (pricing (opens in a new tab)).
Can Elements build a blog or a marketing site?
Yes. Every page renders on the server with its data in the first response, and a page with no event handlers works with JavaScript turned off. The manual includes marketing page and markdown blog recipes, and a post saved to Postgres is live on the next request, with no rebuild.
How do I move an Astro site to Elements?
An agent can port it easily, because its pages, components and server code map onto the Elements app framework's routes, HTML templates and @rpc (opens in a new tab) functions. You keep TypeScript, your Markdown and your npm packages, and you gain sign-in, a database, payments, tests and deploy in the same app.