Logoshadcn-docs-template
DocsDemo
Sections
  • Get Started
Getting Started
  • Introduction
  • Installation
Customization
  • Customizing the Template
  • MDC Components
  • Composables
  • Writing Documentation
Components
  • DocTabs
  • Callout
  • ComponentPreview
  • CommandMenu
  • CopyButton
  • DocsSidebar
  • DocsTableOfContents
  • PageHeader
  • SiteHeader
  • CopyCodeButton
  • DocsCopyPage
  • CodeBlockCommand
  • CommandMenuItem
  • CommandMenuKbd
  • GitHubLink
  • LucideIcon
  • MainNav
  • MobileNav
  • ModeSwitcher
  • PageHeaderDescription
  • PageHeaderHeading
  • SiteBody
  • SiteConfig
  • SiteFooter
  • OgImage (Custom)

PageHeader

PreviousNext

A header component for page hero sections with centered content.

The PageHeader component provides a container for page hero sections with centered, responsive content layout.

Usage

<script setup lang="ts">
import { PageHeader } from '@/components/PageHeader'
import { PageHeaderHeading } from '@/components/PageHeaderHeading'
import { PageHeaderDescription } from '@/components/PageHeaderDescription'
</script>

<template>
  <PageHeader>
    <PageHeaderHeading>
      Welcome to Our Documentation
    </PageHeaderHeading>
    <PageHeaderDescription>
      Learn how to build amazing things with our tools and components.
    </PageHeaderDescription>
  </PageHeader>
</template>

Examples

Basic Header

<template>
  <PageHeader>
    <PageHeaderHeading>Page Title</PageHeaderHeading>
    <PageHeaderDescription>
      A brief description of what this page covers.
    </PageHeaderDescription>
  </PageHeader>
</template>

With Custom Content

You can add any content inside the PageHeader:

<template>
  <PageHeader>
    <PageHeaderHeading>Custom Header</PageHeaderHeading>
    <PageHeaderDescription>
      Description text here.
    </PageHeaderDescription>
    <Button>Get Started</Button>
  </PageHeader>
</template>

Related Components

PageHeaderHeading

The heading component for page titles:

<template>
  <PageHeaderHeading>
    Your Page Title
  </PageHeaderHeading>
</template>

Styling:

  • Large, responsive font sizes (text-4xl on mobile, xl:text-5xl)
  • Primary color text
  • Font weight: semibold
  • Text balance for better wrapping

PageHeaderDescription

The description component for subtitles:

<template>
  <PageHeaderDescription>
    Your page description goes here.
  </PageHeaderDescription>
</template>

Styling:

  • Responsive text sizes (text-base on mobile, sm:text-lg)
  • Muted foreground color
  • Text balance
  • Max width constraint

API Reference

PageHeader

PropTypeDefaultDescription
classHTMLAttributes["class"]undefinedCustom CSS classes

PageHeaderHeading

PropTypeDefaultDescription
classHTMLAttributes["class"]undefinedCustom CSS classes

PageHeaderDescription

PropTypeDefaultDescription
classCustom CSS classesundefinedCustom CSS classes

Layout

The PageHeader component:

  • Uses container-wrapper for responsive width
  • Centers content with flexbox
  • Provides responsive padding (py-8 on mobile, md:py-16, lg:py-20)
  • Adds gap spacing between children
  • Includes border styling via border-grid class

Customization

You can customize the header by:

  • Adding custom classes via the class prop
  • Using Tailwind utilities for spacing and layout
  • Overriding CSS variables for colors and spacing
  • Adding additional child components
DocsTableOfContentsSiteHeader

On This Page

UsageExamplesBasic HeaderWith Custom ContentRelated ComponentsPageHeaderHeadingPageHeaderDescriptionAPI ReferencePageHeaderPageHeaderHeadingPageHeaderDescriptionLayoutCustomization
© shadcn-vue.com