import { Component } from '@angular/core';
import { WrPageHeader } from 'ngwr/page-header';
@Component({ imports: [WrPageHeader] })
export class MyComponent {}Page Header
A page title with slots for breadcrumbs, actions and tags.
Installation
Import the class, and @use the entry point in your global styles: without it the component renders unstyled.
Basic
<wr-page-header title="Settings" subtitle="Manage your workspace">
<div wrPageHeaderActions>
<wr-btn>Invite</wr-btn>
<wr-btn color="primary">Save</wr-btn>
</div>
</wr-page-header>Narrow container (container query)
With responsive, the actions move below the title when the header itself is narrow.
<div style="width: 380px"><wr-page-header responsive …>…</wr-page-header></div>All three slots
Put wrPageHeaderBreadcrumbs, wrPageHeaderActions or wrPageHeaderExtra on any element; nothing to import. Project tags through an <ng-container>.
<wr-page-header title="Billing" subtitle="Plan, invoices and payment method">
<wr-breadcrumbs wrPageHeaderBreadcrumbs>
<wr-breadcrumbs-item>Workspace</wr-breadcrumbs-item>
<wr-breadcrumbs-item>Billing</wr-breadcrumbs-item>
</wr-breadcrumbs>
<div wrPageHeaderActions>
<wr-btn outlined>Download invoices</wr-btn>
<wr-btn color="primary">Change plan</wr-btn>
</div>
<!-- ng-container: the row does not space a wrapper's children. -->
<ng-container wrPageHeaderExtra>
<wr-tag color="success">Active</wr-tag>
<wr-tag>Pro</wr-tag>
</ng-container>
</wr-page-header>API
| Name | Description | Type | Default |
|---|---|---|---|
title | Primary title shown as an h1. | string | '' |
subtitle | Secondary line below the title. | string | '' |
responsive | Stack the title and actions vertically when the header's own box is too narrow to sit them side by side (a container query on its own width, not the viewport — so it adapts inside a narrow column or split pane). | boolean | false |
CSS variables
Set these on the component's selector or a wrapper, not on :root: the defaults are declared on ngwr/page-header's own element.
| Variable | Default | Declared on |
|---|---|---|
--wr-page-header-actions-gap | var(--wr-space-sm) | .wr-page-header |
--wr-page-header-border | var(--wr-border-base) | .wr-page-header |
--wr-page-header-breadcrumbs-font-size | var(--wr-text-sm) | .wr-page-header |
--wr-page-header-extra-gap | var(--wr-space-md) | .wr-page-header |
--wr-page-header-extra-padding-top | var(--wr-space-xs) | .wr-page-header |
--wr-page-header-font-family | var(--wr-font-family-base) | .wr-page-header |
--wr-page-header-gap | var(--wr-space-lg) | .wr-page-header |
--wr-page-header-heading-gap | var(--wr-space-sm) | .wr-page-header |
--wr-page-header-main-gap-x | var(--wr-space-xl) | .wr-page-header |
--wr-page-header-main-gap-y | var(--wr-space-lg) | .wr-page-header |
--wr-page-header-padding-y | var(--wr-space-xl) | .wr-page-header |
--wr-page-header-subtitle-font-size | var(--wr-text-base) | .wr-page-header |
--wr-page-header-subtitle-line-height | var(--wr-leading-normal) | .wr-page-header |
--wr-page-header-title-font-size | var(--wr-text-3xl) | .wr-page-header |
--wr-page-header-title-font-weight | var(--wr-font-weight-bold) | .wr-page-header |
--wr-page-header-title-line-height | var(--wr-leading-tight) | .wr-page-header |
See also
Component BreadcrumbsShows where the current page sits in the site.Component LayoutAn app shell: header, sider, content and footer.Component ToolbarAn action bar with start, center and end zones.Component TabsSwitch between panels, or between routes.Guide Mobile & responsiveMake ngwr layouts work on touch screens and narrow containers.Component BadgeA small label for a count or a status.