#create Component based on browser width
3 messages · Page 1 of 1 (latest)
Hi @frozen heron. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Astro v0.18 introduces a way to customize partial hydration using CSS media queries. You can use the client:media directive to conditionally hydrate a component based on the media condition. Here's an example:
<Component client:media="(min-width: 700px)" />
In this example, the Component will only hydrate once the media condition (min-width: 700px) is met. This means that the component will only be rendered and interactive when the browser width is at least 700px.