Astro · Islands, endpoints and deployment

Add an interactive component

A client: directive hydrates a framework component. Without one, it renders as plain HTML with no JavaScript.

---
import Counter from "../components/Counter.jsx";
---
<Counter client:load />
<Counter client:visible />   <!-- hydrate when scrolled into view -->

Official Astro documentation

More islands, endpoints and deployment commands

All islands, endpoints and deployment commands · Astro cheatsheet

Was this page helpful?