# @unhead/vue

> Full-stack manager built for Vue.

Latest version **3.4.0** (published 2026-08-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @unhead/vue
pnpm add @unhead/vue
yarn add @unhead/vue
bun add @unhead/vue
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.4.0 |
| Published | 2026-08-21 |
| First published | 2022-11-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 82.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1307 |
| Author | Harlan Wilton <harlan@harlanzw.com> |
| Maintainers | harlan_zw |

## Links

- npm: https://www.npmjs.com/package/@unhead/vue
- Repository: https://github.com/unjs/unhead
- Homepage: https://unhead.unjs.io
- Issues: https://github.com/unjs/unhead/issues
- Funding: https://github.com/sponsors/harlan-zw
- npm.io page: https://npm.io/package/@unhead/vue

## Dependencies (4)

- [unhead](https://npm.io/package/unhead.md) 3.4.0
- [hookable](https://npm.io/package/hookable.md) ^6.1.1
- [unplugin](https://npm.io/package/unplugin.md) ^3.3.0
- [@unhead/bundler](https://npm.io/package/@unhead/bundler.md) 3.4.0

## Recent versions

- 3.4.0 (latest) — 2026-08-21
- 2.1.17 (2x) — 2026-08-04
- 3.0.0-rc.4 (rc) — 2026-04-09
- 3.0.0-beta.12 (beta) — 2026-03-10
- 3.0.0-beta.9 (next) — 2026-02-26
- 3.3.2 — 2026-08-13
- 3.3.1 — 2026-08-04
- 3.3.0 — 2026-08-03
- 3.2.3 — 2026-07-22
- 3.2.2 — 2026-07-22
- 3.2.1 — 2026-07-19
- 2.1.16 — 2026-07-19
- 3.2.0 — 2026-07-19
- 3.1.8 — 2026-07-12
- 3.1.7 — 2026-07-01
- … 312 more at https://npm.io/package/@unhead/vue/versions

## README

# @unhead/vue

> Full-stack `<head>` management for Vue applications

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]

## Features

- 🖖 Vue-optimized head management
- 🔄 Reactive titles, meta tags, and other head elements
- 🔍 SEO-friendly head control
- 🖥️ Server-side rendering support
- 📦 Lightweight with zero dependencies (except for Vue & unhead)

## Installation

```bash
# npm
npm install @unhead/vue

# yarn
yarn add @unhead/vue

# pnpm
pnpm add @unhead/vue
```

## Usage

### Setup

#### Client-side (SPA)

```ts
import { createHead } from '@unhead/vue/client'
// main.ts
import { createApp } from 'vue'
import App from './App.vue'

const app = createApp(App)
const head = createHead()
app.use(head)

app.mount('#app')
```

#### Server-side (SSR)

```ts
import { createHead } from '@unhead/vue/server'
// entry-server.ts
import { renderToString } from 'vue/server-renderer'
import { createApp } from './main'

export async function render(url: string) {
  const { app } = createApp()
  const head = createHead()
  app.use(head)

  const html = await renderToString(app)
  return { html, head }
}
```

```ts
import { createHead } from '@unhead/vue/client'
// entry-client.ts (for hydration)
import { createApp } from './main'

const { app } = createApp()
const head = createHead()
app.use(head)

app.mount('#app')
```

### Basic Usage

```vue
<!-- Home.vue -->
<script setup lang="ts">
import { useHead } from '@unhead/vue'

useHead({
  title: 'Home Page',
  meta: [
    {
      name: 'description',
      content: 'Welcome to our website'
    }
  ]
})
</script>

<template>
  <h1>Home</h1>
</template>
```

### Setting Meta Tags

```vue
<!-- About.vue -->
<script setup lang="ts">
import { useSeoMeta } from '@unhead/vue'

useSeoMeta({
  title: 'About Us',
  description: 'Learn more about our company',
  ogTitle: 'About Our Company',
  ogDescription: 'Our fantastic about page',
  ogImage: 'https://example.com/image.jpg',
})
</script>

<template>
  <h1>About Us</h1>
</template>
```

### Reactive Head Elements

```vue
<!-- Profile.vue -->
<script setup lang="ts">
import { useHead } from '@unhead/vue'
import { ref } from 'vue'

const userName = ref('User')

// Vue automatically tracks reactive changes
useHead({
  title: () => `${userName.value} - Profile`, // Reactive title
  meta: [
    {
      name: 'description',
      content: () => `${userName.value}'s profile page`, // Reactive description
    },
  ],
})

function updateName() {
  userName.value = 'New Name'
  // Title and meta automatically update!
}
</script>

<template>
  <h1>{{ userName }}'s Profile</h1>
  <button @click="updateName">
    Update Name
  </button>
</template>
```

## Development

```bash
# Install dependencies
npm install

# Generate build files
npm run build

# Run tests
npm run test
```

## License

[MIT](./LICENSE)

<!-- Badges -->
[npm-version-src]: https://img.shields.io/npm/v/@unhead/vue/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-version-href]: https://npmjs.com/package/@unhead/vue

[npm-downloads-src]: https://img.shields.io/npm/dm/@unhead/vue.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-downloads-href]: https://npmjs.com/package/@unhead/vue

[license-src]: https://img.shields.io/github/license/unjs/unhead.svg?style=flat&colorA=18181B&colorB=28CF8D
[license-href]: https://github.com/unjs/unhead/blob/main/LICENSE

---
_Source: https://npm.io/package/@unhead/vue · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
