Setup

Using Vue? Check out the Vue integration for gomputed getter and ref support.

Install

yarn
yarn add unhead
npm
npm install unhead
pnpm
pnpm add unhead

If your app has SSR, you may also want the SSR package:

yarn
yarn add @unhead/ssr
npm
npm install @unhead/ssr
pnpm
pnpm add @unhead/ssr

Setup

1. Create your head

Start by creating a head instance somewhere in your apps entry.

main.ts
import { createHead } from "unhead"
// Create a global head instance
const head = createHead()

2. Use the useHead composable

Test it's working by adding useHead somewhere in your application.

import { useHead } from 'unhead'
useHead({
title: 'My awesome site'
})

Next Steps

Your app is now setup for head management, congrats! 🎉

Try next:

  1. Optional: Setup SSR
  2. Optional: Setup Auto Imports
  3. Add some recipes