Core Concepts
<Head> Component
Quick Answer: Use <Head>, <Title>, <Meta>, <Link>, and <Script> components for template-based head management. Import from @unhead/vue/components.
What is the Head component?
The Unhead Vue package exports a <Head> component that can be used to manage your head tags.
While it's recommended to use the useHead() composable as it offers a more flexible API with full TypeScript support,
the <Head> component may make more sense for your project.
How do I use the Head component?
The component takes any child elements that you would normally put in your actual <head> and renders them
with Unhead.
<script lang="ts" setup>
import { Head } from '@unhead/vue/components'
</script>
<template>
<Head>
<title>My awesome site</title>
<meta name="description" content="My awesome site description">
</Head>
</template>
When the head component is unmounted, it will remove all the tags that were added.
Did this page help you?