Page Header

Renders a header that is specific to the content of the current page.

Read more Read less

Unlike a site-wide header, which offers consistent navigation and elements like logos throughout the website or application, this component is meant to describe the unique content of each page. For instance, on an article page, it would display the article's title.

It is typically used as a direct child of the <main> element.

Maturity: Developing

Usage

<main>
  <.page_header subtitle="Share Your Pup's Story">
    <:title>Puppy Profiles</:title>
    <:action>
      <.button_link patch={~p"/puppies/new"}>Add New Profile</.button_link>
    </:action>
  </.page_header>

  <section>
    <!-- Content -->
  </section>
</main>

With back link:

<main>
  <.page_header>
    <:title>Puppy Profile</:title>
    <:navigation navigate={~p"/puppies"}>
      Back to puppy list
    </:navigation>
    <:action>
      <.button_link patch={~p"/puppies/new"}>Add New Profile</.button_link>
    </:action>
  </.page_header>

  <section>
    <!-- Content -->
  </section>
</main>
<div style="inline-size: 100%">
  <.page_header subtitle="Share Your Pup's Story">
    <:title>Puppy Profiles</:title>
    <:action>
      <.button_link patch="/puppies/new">Add New Profile</.button_link>
    </:action>
  </.page_header>
</div>
<div style="inline-size: 100%">
  <.page_header subtitle="Share Your Pup's Story">
    <:title>Puppy Profiles</:title>
    <:navigation navigate="/puppies">
      Back to puppy list
    </:navigation>
    <:action>
      <.button_link patch="/puppies/1/edit">Edit Profile</.button_link>
    </:action>
  </.page_header>
</div>
<div style="inline-size: 100%">
  <.page_header>
    <:title>Puppy Profiles</:title>
    <:action>
      <.button_link patch="/puppies/new">Add New Profile</.button_link>
    </:action>
  </.page_header>
</div>
<div style="inline-size: 100%">
  <.page_header subtitle="Share Your Pup's Story">
    <:title>Puppy Profiles</:title>
  </.page_header>
</div>
<div style="inline-size: 100%">
  <.page_header>
    <:title>Puppy Profiles</:title>
  </.page_header>
</div>
<div style="inline-size: 100%">
  <.page_header subtitle="Share Your Pup's Story">
    <:title>Puppy Profiles</:title>
    <:action>
      <.button_link patch="/puppies/1/edit">Edit Profile</.button_link>
    </:action>
    <:action>
      <.button_link patch="/puppies/new">Add New Profile</.button_link>
    </:action>
  </.page_header>
</div>