Partial
Partial
lets you import files from src/content/partials
. They’re used to organize long-form content like landing pages into managable chunks.
-->
Partial
lets you import files from src/content/partials
. They’re used to organize long-form content like landing pages 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!
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!
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.
You can use Partial
by importing the Partial
component and passing path
property to it.
Partials have to be placed in the partials directory (src/content/partials
). Files you put into this directory can be read by the Partial
component.
When you want to import a partial, pass its file name (without extensions) into the path
property.
Recursive nested directories are supported.
To import a nested partial, pass the nested directory path and the file name to the path
property.
Partial
supports md
, mdx
and astro
extensions.
Components
can be passed into partials with the mdx
and mdx
extensions. Alternatively, you can also import components directly within the partial.
Client
directives don’t work on components that are passed into a partial.
If you need client
directives, you need to import the component from the
partial.
Splendid Labz is free because we love developers and we want to contribute back to the ecosystem.
We only charge for access to the documentation to keep the project going. If you don't wish to pay, feel free to use the content from the features tab, our blogs or our videos as your guide.
You can use Partial
by importing the Partial
component and passing path
property to it.
Partials have to be placed in the partials directory (src/content/partials
). Files you put into this directory can be read by the Partial
component.
When you want to import a partial, pass its file name (without extensions) into the path
property.
Recursive nested directories are supported.
To import a nested partial, pass the nested directory path and the file name to the path
property.
Partial
supports md
, mdx
and astro
extensions.
Components
can be passed into partials with the mdx
and mdx
extensions. Alternatively, you can also import components directly within the partial.
Client
directives don’t work on components that are passed into a partial.
If you need client
directives, you need to import the component from the
partial.