Skip to content
Components

App header

A sticky glass header with your brand, navigation and actions.

After the one-time setup, call the helper directly from ERB. No component import is needed.

<%= lc_app_header class: "static w-full p-0 sm:p-0" do |header| %>
  <%= header.brand "#", label: "Studio home" do %>
    <span class="grid size-8 place-items-center rounded-xl bg-foreground text-background"><%= lc_icon "square-3-stack-3d", options: { class: "size-4.5", "aria-hidden": true } %></span>
    Studio
  <% end %>
  <%= header.nav label: "Workspace", class: "max-sm:hidden" do |nav| %>
    <%= nav.link "Overview", "#", current: true %>
    <%= nav.link "Projects", "#" %>
  <% end %>
  <%= header.actions do %>
    <%= lc_icon_button "Search", icon: "magnifying-glass", size: :sm %>
    <%= lc_avatar "AL", size: :sm, class: "bg-primary-soft text-primary" %>
  <% end %>
<% end %>
<%= lc_app_header class: "static w-full p-0 sm:p-0" do |header| %>
  <%= header.brand "#", label: "Studio home" do %>
    <span class="grid size-8 place-items-center rounded-xl bg-foreground text-background"><%= lc_icon "square-3-stack-3d", options: { class: "size-4.5", "aria-hidden": true } %></span>
    Studio
  <% end %>
  <%= header.nav label: "Workspace", class: "max-sm:hidden" do |nav| %>
    <%= nav.link "Overview", "#", current: true %>
    <%= nav.link "Projects", "#" %>
  <% end %>
  <%= header.actions do %>
    <%= lc_icon_button "Search", icon: "magnifying-glass", size: :sm %>
    <%= lc_avatar "AL", size: :sm, class: "bg-primary-soft text-primary" %>
  <% end %>
<% end %>

Helpers render semantic HTML and include their interaction wiring. Pass native attributes through class:, data:, aria: and the usual Rails options. Blocks use captured ERB content.

lc_app_header

lc_app_header(bar: {}, **attributes, &block)
InputDefaultValues
bar{}—
attributes{}Native HTML attributes; class:, data: and aria: merge with defaults
blockCaptured blockCaptured Rails ERB content

lc_app_header yields a builder, header, with these parts. Each part carries data-slot and merges class: and native attributes.

header.brand

header.brand(url = "/", label:, **attributes, &block)
InputDefaultValues
url"/"—
labelRequiredAccessible name, visible where applicable
attributes{}Native HTML attributes; class:, data: and aria: merge with defaults
blockCaptured blockCaptured Rails ERB content

header.nav

header.nav(label: view.send(:lc_t, "lostcoords.ui.app_header.navigation"), **attributes, &block)
InputDefaultValues
labelview.send(:lc_t, "lostcoords.ui.app_header.navigation")Accessible name, visible where applicable
attributes{}Native HTML attributes; class:, data: and aria: merge with defaults
blockCaptured blockCaptured Rails ERB content

header.actions

header.actions(**attributes, &block)
InputDefaultValues
attributes{}Native HTML attributes; class:, data: and aria: merge with defaults
blockCaptured blockCaptured Rails ERB content

The examples also use lc_icon, lc_icon_button, and lc_avatar. Each is documented on its own page.

Styling and extension

Use class: to merge utilities, native attributes for application behavior, and the theming guide for the shared palette. For custom markup, the advanced class helpers expose the same styles, including glass surfaces and class merging.

API JSON · LLM reference