Full-stack <head> manager built for any framework.
npm install unhead> Full-stack manager built for any framework
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]
- 🚀 Framework agnostic - works with any framework
- 🔄 Reactive head management
- 🔍 SEO-friendly with rich meta tag support
- 🖥️ Server-side rendering support
- 📦 Lightweight and tree-shakable
- ⚡ Performance optimized with minimal runtime overhead
- 🎯 Type-safe with full TypeScript support
``bashnpm
npm install unhead
Usage
$3
`ts
import { createHead, useHead } from 'unhead'// Create a head instance
const head = createHead()
// Use head tags
useHead({
title: 'My App',
meta: [
{
name: 'description',
content: 'My awesome application'
}
]
}, { head })
`$3
`ts
import { createHead, renderSSRHead } from 'unhead/server'const head = createHead()
// Add head entries
useHead({
title: 'SSR App',
meta: [{ name: 'description', content: 'Server-rendered app' }]
}, { head })
// Render head tags
const { headTags, bodyTags } = await renderSSRHead(head)
`$3
`ts
import { createHead, renderDOMHead } from 'unhead/client'const head = createHead()
// Enable DOM rendering
renderDOMHead(head)
// Add reactive head entries
useHead({
title: 'Client App'
}, { head })
`Framework Integrations
Unhead provides optimized integrations for popular frameworks:
@unhead/vue
- React: @unhead/react
- Angular: @unhead/angular
- Svelte: @unhead/svelte
- SolidJS: @unhead/solid-js`Visit the documentation site for comprehensive guides and API references.
[npm-version-src]: https://img.shields.io/npm/v/unhead/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-version-href]: https://npmjs.com/package/unhead
[npm-downloads-src]: https://img.shields.io/npm/dm/unhead.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-downloads-href]: https://npmjs.com/package/unhead
[license-src]: https://img.shields.io/github/license/unjs/unhead.svg?style=flat&colorA=18181B&colorB=28CF8D
[license-href]: https://github.com/unjs/unhead/blob/main/LICENSE