Components
Use nertia sections in your own project
Pull a section or a theme into any shadcn project, or scaffold a whole site from a recipe.
nertia publishes its sections and themes as a shadcn registry at ner.sh/r, for developers who want them in their own project. You copy the files into your project and you own them. Each portable item's page in the catalogue shows its install command.
Add one item
This works in any shadcn project, with no setup. Swap <id> for the item's id.
npx shadcn@latest add https://ner.sh/r/<id>.json
Set up the registry once
Add @nertia to the registries entry in your components.json.
{
"registries": {
"@nertia": "https://ner.sh/r/{name}.json"
}
}
Then every item has a short form.
npx shadcn@latest add @nertia/<id>
Start a new project
create-nersh scaffolds a Next.js project that pulls its sections from the registry. When it returns, your sections are real files in src/sections/.
npm create nersh@latest my-site
To start from a site you built on nertia, export it and pass the file with --site.
npm create nersh@latest my-site -- --site ./my-site.nertia.json
Add a theme
Each preset skin is a theme item. It writes the :root, .dark and @theme inline blocks into app/globals.css. Swap zinc for any preset, such as rose or teal.
npx shadcn@latest add @nertia/theme-zinc
What is portable
The foundation leaves, the section patterns and the 26 themes are registry items today. The widget sections, such as the navbar, the footer and booking, run on nertia only for now. Their item pages say so and offer the recipe and Open in nertia instead. A scaffold skips them with a line saying which ones, and keeps going.
Code Embed is a registry item too. A scaffold installs it with the site's other sections and runs its code in the same sealed frame as on nertia; see Code Embed in an exported site. Its id is block-code-embed; it has no page in the catalogue.
A scaffolded project depends on @nersh/render, the renderer that reads your site.json, applies the skin and lays out the sections. It is MIT licensed and updates like any npm package. An update never touches your sections.
The full flag list is in the create-nersh readme.