hartmut-co-uk / unhead

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

Home Page:https://unhead.harlanzw.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unhead

NPM version NPM Downloads GitHub stars

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


Status: Stable
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

About

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

https://unhead.harlanzw.com


Languages

Language:TypeScript 100.0%