Back to articles
Astro Has a Free API: The Content-First Framework That Ships Zero JavaScript by Default

Astro Has a Free API: The Content-First Framework That Ships Zero JavaScript by Default

via Dev.to WebdevAlex Spinov

Astro is a web framework that ships zero JavaScript by default. It renders HTML on the server and only hydrates interactive components — use React, Vue, Svelte, or Solid in the same project. Why Astro? Zero JS by default — ships pure HTML, CSS Islands architecture — hydrate only interactive parts Any UI framework — React + Vue + Svelte in one project Content collections — type-safe Markdown/MDX content Blazing fast — consistently tops web framework benchmarks Quick Start npm create astro@latest my-site cd my-site npm run dev # http://localhost:4321 Pages (File-Based Routing) --- // src/pages/index.astro const title = 'My Site'; const users = await fetch('https://api.example.com/users').then(r => r.json()); --- <html> <head><title>{title}</title></head> <body> <h1>{title}</h1> <ul> {users.map(user => <li>{user.name}</li>)} </ul> </body> </html> Islands (Partial Hydration) --- // src/pages/dashboard.astro import ReactChart from '../components/Chart.tsx'; // React import VueSearch from '.

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
2 views

Related Articles