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.

import { Component } from '@angular/core';
import { WrPageHeader } from 'ngwr/page-header';

@Component({ imports: [WrPageHeader] })
export class MyComponent {}

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>

Settings

Manage your workspace

InviteSave

Narrow container (container query)

With responsive, the actions move below the title when the header itself is narrow.

Settings

Manage your workspace

InviteSave
<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>

Billing

Plan, invoices and payment method

Download invoicesChange plan
ActiveProRenews 1 Nov

API

NameDescriptionTypeDefault
titlePrimary title shown as an h1.string''
subtitleSecondary line below the title.string''
responsiveStack 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).booleanfalse

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.

VariableDefaultDeclared on
--wr-page-header-actions-gapvar(--wr-space-sm).wr-page-header
--wr-page-header-bordervar(--wr-border-base).wr-page-header
--wr-page-header-breadcrumbs-font-sizevar(--wr-text-sm).wr-page-header
--wr-page-header-extra-gapvar(--wr-space-md).wr-page-header
--wr-page-header-extra-padding-topvar(--wr-space-xs).wr-page-header
--wr-page-header-font-familyvar(--wr-font-family-base).wr-page-header
--wr-page-header-gapvar(--wr-space-lg).wr-page-header
--wr-page-header-heading-gapvar(--wr-space-sm).wr-page-header
--wr-page-header-main-gap-xvar(--wr-space-xl).wr-page-header
--wr-page-header-main-gap-yvar(--wr-space-lg).wr-page-header
--wr-page-header-padding-yvar(--wr-space-xl).wr-page-header
--wr-page-header-subtitle-font-sizevar(--wr-text-base).wr-page-header
--wr-page-header-subtitle-line-heightvar(--wr-leading-normal).wr-page-header
--wr-page-header-title-font-sizevar(--wr-text-3xl).wr-page-header
--wr-page-header-title-font-weightvar(--wr-font-weight-bold).wr-page-header
--wr-page-header-title-line-heightvar(--wr-leading-tight).wr-page-header

See also