Overview - Why Astro components use a unique format
What is it?
Astro components use a unique format that blends HTML, JavaScript, and optional frontmatter in a single file. This format allows developers to write components that render static HTML by default but can also include interactive JavaScript when needed. It is designed to optimize website performance by sending less JavaScript to the browser. The format supports multiple frameworks inside one project, making it flexible and efficient.
Why it matters
This unique format solves the problem of slow websites caused by heavy JavaScript. Without it, websites often send too much JavaScript to users, making pages load slowly and use more data. Astro's approach lets developers build fast, modern sites that only load the JavaScript needed for interactivity. This improves user experience, especially on slow connections or devices.
Where it fits
Before learning Astro components, you should understand basic HTML, JavaScript, and how web pages load. After this, you can explore how Astro integrates with popular frameworks like React or Vue. Later, you can learn about server-side rendering and partial hydration, which build on Astro's component format to optimize performance.
