Page title

2 snippets across 2 stacks — HTML & CSS, React

HCHTML & CSS

Page Title

HC · Meta & SEO
syntax
<title>Page Title - Site Name</title>
example
<head>
  <title>Pricing Plans - CloudDash</title>
</head>

Note The title appears in browser tabs, bookmarks, and search engine results. Keep it under 60 characters. Place the specific page name before the site name for better scannability.

REReact

Document Metadata

RE · React 19 Features
syntax
// Render <title>, <meta>, <link> directly in components
function Page() {
  return (
    <>
      <title>Page Title</title>
      <meta name="description" content="..." />
      {/* page content */}
    </>
  );
}
example
function ProductPage({ product }) {
  return (
    <article>
      <title>{product.name} | ShopApp</title>
      <meta name="description" content={product.summary} />
      <link rel="canonical" href={`/products/${product.slug}`} />

      <h1>{product.name}</h1>
      <p>{product.description}</p>
      <strong>${product.price}</strong>
    </article>
  );
}

// React hoists these tags into the <head> automatically

Note In React 19, metadata tags rendered inside components are automatically hoisted into the document <head>. This eliminates the need for third-party helmet libraries for basic metadata management. Works with SSR and client rendering.