Export document.head for site-wide head tags and page-level SEO.
Bini.js uses the document export for document-level configuration. Export a document object containing a head node tree to configure your site's title, meta tags, scripts, and JSON-LD.
| Export | Best for | Where to use |
|---|---|---|
| document | Raw head tags, scripts, JSON-LD | Root layout (layout.tsx) |
document export is statically extracted at build time and removed from the client bundle. It is applied during static rendering and injected into the static HTML.In the root layout, export a document object with a head node tree. All standard head tags, JSON-LD scripts, and initialization scripts go here. This is the pattern used by every Bini.js project.
document.head is a full JSX node tree. It is serialized into the static HTML. Attributes and children must be static, otherwise they are dropped.Open Graph tags control previews on Facebook, LinkedIn, and Slack.
Twitter (X) card fields control how links appear in the feed.
Add icon links directly to document.head.
Put static assets in public/. Reference them by absolute path in document.head.
public/ are served as-is.For page-specific head tags, you can export document from inner layouts. The nearest document export wins (page first, then the closest layout). Documents are not merged.
During vite build, the document export is serialized into the static HTML.
The root layout uses document.head for the site-wide head. Inner pages can override it with a their own document export.
Control social preview cards.
Set icons and web manifests.
Create your first pages and wrap them in shared layouts.
Match URL segments with dynamic parameters and catch-alls.
Deploy to Node, Vercel, Netlify, Cloudflare, or Deno, or build native apps in CI.
Review CLI flags and system requirements.
Export document.head for site-wide head tags and page-level SEO.
Bini.js uses the document export for document-level configuration. Export a document object containing a head node tree to configure your site's title, meta tags, scripts, and JSON-LD.
| Export | Best for | Where to use |
|---|---|---|
| document | Raw head tags, scripts, JSON-LD | Root layout (layout.tsx) |
document export is statically extracted at build time and removed from the client bundle. It is applied during static rendering and injected into the static HTML.In the root layout, export a document object with a head node tree. All standard head tags, JSON-LD scripts, and initialization scripts go here. This is the pattern used by every Bini.js project.
document.head is a full JSX node tree. It is serialized into the static HTML. Attributes and children must be static, otherwise they are dropped.Open Graph tags control previews on Facebook, LinkedIn, and Slack.
Twitter (X) card fields control how links appear in the feed.
Add icon links directly to document.head.
Put static assets in public/. Reference them by absolute path in document.head.
public/ are served as-is.For page-specific head tags, you can export document from inner layouts. The nearest document export wins (page first, then the closest layout). Documents are not merged.
During vite build, the document export is serialized into the static HTML.
The root layout uses document.head for the site-wide head. Inner pages can override it with a their own document export.
Control social preview cards.
Set icons and web manifests.
Create your first pages and wrap them in shared layouts.
Match URL segments with dynamic parameters and catch-alls.
Deploy to Node, Vercel, Netlify, Cloudflare, or Deno, or build native apps in CI.
Review CLI flags and system requirements.