Book a call Free rebuild
Home/Glossary/Astro/Astro Components

Astro Components

By Seahawk November 16, 2026

Astro glossaryAstro components are .astro files: reusable pieces of HTML with a script section on top. They render on the server and send no JavaScript by default.

An Astro component is a .astro file: a reusable piece of a page, such as a header, a card, or a whole layout. It has two parts: a component script between --- fences at the top, where you import things, fetch data, and read props, and an HTML template below it that can use those values.

Astro components render to HTML on the server (or at build time) and send no JavaScript to the browser. Anything interactive is either a small <script> tag or a framework component turned into an island.

Styles written in a component's <style> tag are scoped to that component by default, so they do not leak into the rest of the site.

Source: Astro docs: Components.

Em Workers

EmDash and Astro sites at revolutionary pricing.

Lightning-fast, secure websites delivered on EmDash and Astro. For the AI-curious bunch.