Skip to content

censujiang/unhead

 
 

Repository files navigation

Unhead

NPM version NPM Downloads GitHub stars

Universal document tag manager. Tiny, adaptable and full featured.


Status: v1.3 Released
Please report any issues 🐛
Made possible by my Sponsor Program 💖
Follow me @harlan_zw 🐦 • Join Discord for help

Highlights

  • 🌳 Powerful pluggable core with a tiny footprint
  • 🍣 All the good stuff: deduping, sorting, title templates, template params, etc.
  • 🪨 Dependable DOM updates, fast and tiny (952 bytes minzipped)
  • 🚀 Add-ons for extra oomph: Capo.js, Hash Hydration and Vite tree-shaking
  • 💎 Fully typed with MDN docs
  • 🤝 Used by Nuxt with more framework support coming soon.

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

About

Universal document <head> tag manager. Tiny, adaptable and full-featured.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%