Unhead is the any-framework document head manager with a focus on delightful DX and performance.
// all the goodies
useHead({
// Titles
title: 'Hello World',
titleTemplate: '%s %separator %siteName',
// Template params
templateParams: { separator: '|', siteName: 'My App' },
// Classes
bodyAttrs: { class: { overflow: true } },
// Deduping
script: [{ key: '123', src: 'https://example.com/script.js' }],
})
With deduping, sorting, title templates, template params and dom events out of the box.
Custom side-effect based algorithm to play nicely with your existing tags.
Hook into any part of the head rendering process using Hookable.
Boost your performance with custom plugins: Capo.js ordering, Vite tree-shaking, etc.
Full TypeScript head schema with MDN documentation.
Adopted by the Vue ecosystem with hundreds of bugs squished.