---
title: "Starter Recipes · Unhead"
canonical_url: "https://unhead.unjs.io/docs/vue/head/guides/get-started/starter-recipes"
last_updated: "2026-08-04T22:44:40.055Z"
meta:
  description: "Examples for SEO metadata, social previews, favicons, web app manifests, and article metadata."
  "og:description": "Examples for SEO metadata, social previews, favicons, web app manifests, and article metadata."
  "og:title": "Starter Recipes · Unhead"
---

Home

`
Unhead on GitHub

Switch to VueSwitch to TypeScriptSwitch to ReactSwitch to SvelteSwitch to Solid.jsSwitch to AngularSwitch to Nuxt

**Get Started**

# **Starter Recipes**

[Copy for LLMs](https://raw.githubusercontent.com/unjs/unhead/refs/heads/main/docs/head/1.guides/0.get-started/4.starter-recipes.md)

These recipes cover basic SEO, social sharing metadata, blog posts, favicons, and PWA tags.

For a searchable catalog of head tags, see the [**~~Zhead Head Tag Database~~**](https://zhead.dev/).

## Default server tags

The server head adds these defaults unless you create it with `**disableDefaults: true**`. You can override them with later entries.

- `<html lang="en">`: Sets the document's default language.
- `<meta charset="utf-8">`: Selects UTF-8 character encoding.
- `<meta name="viewport" content="width=device-width, initial-scale=1">`: Sets the layout viewport to the device width at the initial zoom level.

An HTML charset declaration must appear entirely within the document's first 1024 bytes, which is why it belongs at the start of `**<head>**`. See the MDN references for [`**<meta charset>**`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta#charset) and [**~~viewport metadata~~**](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name/viewport).

## Basic SEO metadata

This recipe sets the document language, title, description, and canonical URL. Add the [**~~social preview metadata~~**](#social-preview-metadata) when links to the page will be shared on other platforms.

A canonical URL is a strong signal, not a directive, and Google may select a different representative URL. Use a self-referencing canonical and keep canonical signals consistent across HTML, redirects, and sitemaps. See [**~~Google's canonicalization guidance~~**](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls).

```
import { useHead, useSeoMeta } from '@unhead/vue'

// [useHead](/docs/head/api/composables/use-head): general head tag management
// [useSeoMeta](/docs/head/api/composables/use-seo-meta): type-safe SEO meta tags
useHead({
  htmlAttrs: { lang: 'en-US' }, // BCP 47 language code
  link: [{
    rel: 'canonical',
    href: 'https://www.example.com/about'
  }]
})

useSeoMeta({
  title: 'About Us',
  titleTemplate: '%s - Site',
  description: 'Meet the team and learn how the company works.',
})
```

### Additional Open Graph fields

These optional [**~~Open Graph~~**](https://ogp.me/) properties identify the page type, URL, locale, and site name.

```
import { useSeoMeta } from '@unhead/vue'

useSeoMeta({
  ogType: 'website',
  ogUrl: 'https://www.example.com/about', // should match canonical URL
  ogLocale: 'en_US',
  ogSiteName: 'My Site',
})
```

### SEO tips

- Google Search [**~~ignores ~~**`**<meta name="keywords">**`](https://developers.google.com/search/docs/crawling-indexing/special-tags); it has no effect on indexing or ranking.
- Avoid duplicate titles and descriptions across your site. If several URLs serve the same content, use `<link rel="canonical">` to indicate the preferred URL. Google recommends an absolute URL and may still select another canonical.

## Social preview metadata

Social platforms use [**~~Open Graph metadata~~**](https://ogp.me/) and platform-specific fields to build link previews. Set the preview title, description, and image explicitly when they should differ from the page's HTML metadata.

```
import { useSeoMeta } from '@unhead/vue'

useSeoMeta({
  // title & descriptions
  ogTitle: 'Travel Keyboard',
  ogDescription: 'A compact mechanical keyboard with hot-swappable switches and Bluetooth pairing.',
  // Legacy X-specific account metadata; these fields are deprecated in the schema
  twitterSite: '@example',
  twitterCreator: '@example',
  // og image
  ogImage: {
    url: 'https://example.com/og-image.png',
    width: 1200,
    height: 630,
    alt: 'Travel Keyboard in its carrying case',
    type: 'image/png'
  },
  // \`twitterImage\` is deprecated; use \`ogImage\`
  twitterCard: 'summary_large_image', // or summary
  // Legacy X-specific label and data metadata
  twitterLabel1: 'Price',
  twitterData1: '$50',
  twitterLabel2: 'Read Time',
  twitterData2: '10 min',
})
```

Google can also use `**og:image**`, Schema.org's `**primaryImageOfPage**`, or an image attached to the page's main entity as preferred-image signals for text results and Discover. Selection remains automatic. Choose a relevant, representative, high-resolution image rather than a generic logo or one with an extreme aspect ratio; see Google's [**~~preferred-image guidance~~**](https://developers.google.com/search/docs/appearance/google-images#specify-preferred-image).

### Social sharing tips

- Open Graph defines `**og:title**`, `**og:type**`, `**og:image**`, and `**og:url**` as its basic fields. If you provide an image, also provide descriptive `**og:image:alt**` text.
- Add `**twitterCard**` when you need an X-specific card type; the other X-specific fields in this example are retained only for legacy schema compatibility.
- Write titles and descriptions for the context in which people will encounter the shared link.

## Article metadata

For an article, add publication details to the [**~~basic SEO~~**](#basic-seo-metadata) and [**~~social preview~~**](#social-preview-metadata) tags.

```
import { useHead, useSeoMeta } from '@unhead/vue'

useSeoMeta({
  ogType: 'article',
  articlePublishedTime: '2023-04-01T12:00:00Z',
  articleModifiedTime: '2023-05-10T14:45:00Z',
  articleAuthor: ['https://site.com/authors/john-doe'],
  articleSection: 'Technology', // category
  articleTag: ['JavaScript'],
  twitterLabel1: 'Author',
  twitterData1: 'John Doe',
  twitterLabel2: 'Read Time',
  twitterData2: '10 min',
})

// link to previous and next posts
useHead({
  link: [
    { rel: 'prev', href: 'https://site.com/blog/previous' },
    { rel: 'next', href: 'https://site.com/blog/next' }
  ]
})
```

### Blog post tips

- Combine it with [**~~BlogPosting~~**](https://unhead.unjs.io/docs/schema-org/guides/recipes/blog) Schema.org to provide more semantic meaning to your page.

## Favicons and theme colors

Use icon links for browser and device icons, then set theme colors for supported browser chrome.

```
import { useHead } from '@unhead/vue'

useHead({
  link: [
    { rel: 'icon', href: '/favicon.ico' },
    { rel: 'icon', href: '/favicon.svg', sizes: 'any', type: 'image/svg+xml' },
    { rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' },
  ],
  meta: [
    // used on some mobile browsers
    { name: 'theme-color', content: '#0000FF' },
    // choose light or dark (or both, see Light + Dark Mode)
    { name: 'color-scheme', content: 'light dark' },
  ]
})
```

### Favicon tips

- An ICO file can contain several bitmap sizes, while `**sizes="any"**` indicates a scalable icon such as SVG. See the [**~~MDN icon reference~~**](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link#providing_icons_for_different_usage_contexts).
- For Google Search, use a stable, crawlable square favicon. Google requires at least 8×8 pixels and recommends more than 48×48 pixels. See [**~~Google's favicon guidelines~~**](https://developers.google.com/search/docs/appearance/favicon-in-search).
- Add an SVG icon alongside the ICO fallback if you want a scalable favicon.

## Web app metadata

The `**manifest**` link associates the document with a [**~~web app manifest~~**](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/manifest). The theme fields affect supported browsers and installed apps; a document-level `**theme-color**` can [**~~override the manifest value~~**](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/How_to/Customize_your_app_colors).

```
import { useHead } from '@unhead/vue'

useHead({
  link: [
    { rel: 'manifest', href: '/manifest.json' },
    { rel: 'apple-touch-icon', href: '/apple-touch-icon.png' }
  ],
  meta: [
    { name: 'viewport', content: 'width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=5, viewport-fit=cover' },
    { name: 'theme-color', content: '#0000FF' },
    { name: 'apple-mobile-web-app-capable', content: 'yes' },
    { name: 'apple-mobile-web-app-status-bar-style', content: 'default' }
  ]
})
```

## See Also

- [**~~Titles Guide~~**](https://unhead.unjs.io/docs/head/guides/core-concepts/titles): Page title management
- [**~~useHead() API~~**](https://unhead.unjs.io/docs/head/api/composables/use-head): Full API reference
- [**~~useSeoMeta() API~~**](https://unhead.unjs.io/docs/head/api/composables/use-seo-meta): SEO meta tags

[~~Edit this page~~](https://github.com/unjs/unhead/edit/main/docs/head/1.guides/0.get-started/4.starter-recipes.md)

[~~Markdown For LLMs~~](https://raw.githubusercontent.com/unjs/unhead/refs/heads/main/docs/head/1.guides/0.get-started/4.starter-recipes.md)

**Did this page help you? **

[**Single Page Applications** Ship useful fallback head tags from an SPA, then prerender public routes so crawlers receive route-specific metadata.](https://unhead.unjs.io/docs/head/guides/get-started/single-page-applications) [**Titles & Title Templates** Manage page titles with useHead, title templates, reactive values, social metadata, and template params.](https://unhead.unjs.io/docs/head/guides/core-concepts/titles)

**On this page **

- [Default server tags](#default-server-tags)
- [Basic SEO metadata](#basic-seo-metadata)
- [Social preview metadata](#social-preview-metadata)
- [Article metadata](#article-metadata)
- [Favicons and theme colors](#favicons-and-theme-colors)
- [Web app metadata](#web-app-metadata)
- [See Also](#see-also)