Organize large files into managable chunks
So they become easier to remember, find, parse, and edit — and you have an easier time maintaining your site or creating new things on them!
<Partial path="landing/intro" /><Partial path="landing/features" /><Partial path="landing/... other files ..." /><Partial path="landing/call-to-action" />
Pass components into partials or import them from the partial
Common components can be passed directly into partials so you don’t always have to import
them in every file and, you can still import additional components whenever you need — best of both worlds!
---import Comp1 from '@/components/Comp1.astro'import Comp2 from '@/components/Comp2.astro'const components = { Comp1, Comp2 }---
<Partial path="file" {components} />
{/* partial.mdx */}import Comp1 from '@/components/Comp1.astro'import Comp2 from '@/components/Comp2.astro'
{/* Usage */}<Comp1 /><Comp2 />
No JavaScript voodoo required
Unlike Astro’s built-in partial
feature, Partial
does not need any JavaScript to work.
Just use Partial
and your partials will be added into your HTML in the order you state.
<Partial path="loaded" /><Partial path="without" /><Partial path="javascript" />