Header

Page header component with title, subtitle and actions.

Page Title

A brief description of the page content.

Usage

<%= ui.header do %>
  <%= ui.header_heading do %>
    <%= ui.header_title "Title" %>
  <% end %>
<% end %>

<%= ui.header bordered: true do %>
  <%= ui.header_heading do %>
    <%= ui.header_title "Title" %>
    <%= ui.header_subtitle "Subtitle" %>
  <% end %>
  <%= ui.header_actions do %>
    <%= ui.btn "Action" %>
  <% end %>
<% end %>
Props
PropTypeDefaultDescription
directionSymbol
:col | :row
:rowLayout direction of the header. Row direction is responsive (column on mobile, row on desktop).
alignSymbol
:start | :center | :end
:startVertical alignment of header content.
justifySymbol
:start | :center | :end | :between
:betweenHorizontal justification of header content.
stickyBooleanfalseWhether the header should stick to the top of the viewport on scroll.
borderedBooleanfalseWhether to show a bottom border on the header.

Also accepts any HTML attributes via **options (e.g., id:, data:, aria:, class:). class: is also supported for custom styling.

Subcomponents
NameHelperDescription
header_headingui.header_headingContainer for title and subtitle elements.
header_titleui.header_titleMain page title element (h1).
header_subtitleui.header_subtitleSecondary description text with muted styling.
header_actionsui.header_actionsContainer for action buttons on the right side.

Examples

Default Header

Page Title

A brief description of the page content.

<%= ui.header do %>
  <%= ui.header_heading do %>
    <%= ui.header_title "Page Title" %>
    <%= ui.header_subtitle "A brief description of the page content." %>
  <% end %>
  <%= ui.header_actions do %>
    <%= ui.btn "Primary Action" %>
    <%= ui.btn "Secondary", variant: :secondary %>
  <% end %>
<% end %>

Bordered Header

Bordered Header

Header with a bottom border separator.

<%= ui.header bordered: true do %>
  <%= ui.header_heading do %>
    <%= ui.header_title "Bordered Header" %>
    <%= ui.header_subtitle "Header with a bottom border separator." %>
  <% end %>
  <%= ui.header_actions do %>
    <%= ui.btn "Action", variant: :outline %>
  <% end %>
<% end %>

Sticky Header

Sticky Header

This header sticks to the top on scroll.

<%= ui.header sticky: true, bordered: true do %>
  <%= ui.header_heading do %>
    <%= ui.header_title "Sticky Header" %>
    <%= ui.header_subtitle "This header sticks to the top on scroll." %>
  <% end %>
  <%= ui.header_actions do %>
    <%= ui.btn "Action" %>
  <% end %>
<% end %>