Unhead
Universal document tag manager. Tiny, adaptable and full featured.
Status: v1.1.0 Released Please report any issues Made possible by my Sponsor Program Follow me @harlan_zw 🐦 • Join Discord for help |
Highlights
💎 Fully typed augmentable Schema powered by zhead🧑🤝🧑 Side-effect based DOM patching, plays nicely your existing other tags and attributes🤝 Built for everyone: Vue, React (soon), Svelte (soon), (more soon).🚀 Optimised, tiny SSR and DOM bundles🖥️ useServerHead
(supporting 0kb runtime)🍣 Intuitive deduping, sorting, title templates, class merging and more🪝 Extensible hook / plugin based API
Install
npm i unhead
Usage
For specific frameworks integrations, see the docs.
Basic
Create the head client somewhere in your root application.
import { createHead } from 'unhead'
createHead()
Then use the composables anywhere you want.
// pages/about.js
import { useHead } from 'unhead'
useHead({
title: 'About',
meta: [
{ name: 'description', content: 'Learn more about us.' },
],
})
Docs
Visit the documentation site for guides and API reference.
Sponsors
License
MIT License © 2022-PRESENT Harlan Wilton