#astro components in solid js
3 messages · Page 1 of 1 (latest)
Hi @hoary marlin. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
No, you cannot import Astro components (i.e., .astro files) directly inside SolidJS components. UI framework components like SolidJS must be written entirely as valid code for that framework, using only its own imports and packages. Astro components cannot be imported into framework components such as .jsx, .tsx, or .svelte files.
However, you can use the Astro <slot /> pattern to pass static content generated by Astro components as children to your framework components, but this must be done inside an .astro component—not inside the SolidJS component itself. This means you can compose Astro and SolidJS components together at the Astro layer, but not by importing .astro files into SolidJS files.
Any UI framework component becomes an “island” of that framework. These components must be written entirely as valid code for that framework, using only its own imports and packages. You cannot import
.astrocomponents in a UI framework component (e.g..jsxor.svelte)
Can I use Astro components inside my framework components?