lantern

Layout

App shell

Brand, breadcrumb bar, collapsible sidebar and main column.

The chrome around this page — the top bar (brand · breadcrumb · actions), the fixed collapsible sidebar, and the main column — is <.app_shell>, built from lantern-ui components. Slots: :brand (corner logo), :header (inline breadcrumbs/switchers), :actions (top-right), and :sidebar (nav_group / nav_item). The collapse control at the sidebar foot persists per id.

A real, interactive <.app_shell> — brand · breadcrumb · actions over a collapsible sidebar and a main column. Rendered in an iframe because app_shell is position: fixed; the collapse control at the sidebar foot works here too.

<.app_shell id="app">
  <:brand><.icon name="bolt" /> <span class="lui-brand-name">Acme</span></:brand>
  <:header><.breadcrumb>…</.breadcrumb></:header>
  <:actions><.button variant="outline" size="sm">Account</.button></:actions>

  <:sidebar>
    <.nav_group label="Workspace">
      <.nav_item label="Dashboard" icon="chart-bar" navigate={~p"/"} active />
      <.nav_item label="Buckets" icon="cloud" navigate={~p"/buckets"} />
    </.nav_group>
  </:sidebar>

  <%!-- page content --%>
</.app_shell>

Action bar

breadcrumb_bar with a trail plus :actions: trail left, actions right, one bar instead of a stacked breadcrumb and title row.

Page shell

One page identity per route: the last crumb is the page title, the h1 is visually hidden, and actions are descriptor maps on the same row.

Projects

Manage deployed resources.

Overflow

Only the first :max_inline entries (default 2) are quick buttons; the rest fold into the More menu. The same fold applies to the quick buttons themselves as the bar narrows, so nothing becomes unreachable on small screens.

Destructive entry

Put data-confirm on the :actions slot. A folded item renders from slot attrs and never its body, so a confirm placed only on an inner button is lost once the entry folds.

API reference

Props and slots, introspected from the component.

app_shell/1
Prop Type Default Description
class any nil Extra classes merged onto the root element.
collapsed boolean false Initial sidebar collapsed (icon-rail) state.
compact boolean false Opt in to the slim shell topline height.
id* string — stable id — the collapse state is persisted per id
Slots
:actions top-right of the bar (user menu, etc.)
:brand* logo/name, top-left corner
:breadcrumb compact sticky trail under the appbar (pass <.breadcrumb>)
:breadcrumb_actions Right-side actions on the breadcrumb bar (same region as breadcrumb_bar/1 :actions). Omitted when empty so existing call sites stay unchanged.
:header inline context after the brand (switchers, etc.)
:inner_block* Main content column.
:sidebar* nav_group / nav_item
:sidebar_footer Persistent links pinned below the nav and above the collapse control (support, docs, legal). Pass `nav_link/1`s. Hidden on the icon rail, where there is no room for text-only links.
:sidebar_header Top of the sidebar, above the nav groups: an org or workspace switcher, for example a dropdown. On the icon rail it stays visible, so the content should collapse to an avatar: style it with `.lui-app[data-collapsed] .your-class`.
nav_group/1
Prop Type Default Description
class any nil Extra classes merged onto the root element.
label string nil Group heading; hides when the rail is collapsed.
Slots
:inner_block* nav_item children in this group.
nav_item/1
Prop Type Default Description
active boolean false Highlight as the current page.
badge any nil A count or short marker for what is waiting behind this link. Sits at the end of the row, and shrinks to a dot on the collapsed rail. Pass `nil` for none — a badge reading `0` is a badge saying there is nothing to see.
class any nil Extra classes merged onto the root element.
expanded boolean false Initial open state when a `:subnav` is present.
href string nil External or full-page href; renders as a link.
icon string nil Leading icon. A lantern icon-set name (e.g. `chart-bar`), or a host heroicon name (`hero-*`) rendered as a CSS-mask span so an app can keep its own icons.
label* string — Nav label; becomes the collapsed-rail tooltip.
navigate string nil LiveView navigate target; renders as a link.
patch string nil LiveView patch target; renders as a link.
Slots
:subnav Nested nav_items. When present the item becomes an expandable section.
breadcrumb_bar/1
Prop Type Default Description
class any nil Extra classes merged onto the root element.
id string nil Stable id for the overflow menu when multi-entry actions collapse; auto-generated when omitted.
max_inline integer 2 How many entries render as quick buttons before the rest fold into the More menu.
Slots
:actions Right-side actions. The first `:max_inline` entries render as quick buttons; the rest fold into a More menu.
:inner_block* Usually a single <.breadcrumb>.
page_shell/1
Prop Type Default Description
actions list [] Action descriptor maps rendered by action_bar/1.
breadcrumb_label string "Breadcrumb" Accessible name for the breadcrumb navigation.
breadcrumbs list [] Ancestor crumb maps with a label and optional navigation target.
class any nil Extra classes merged onto the page shell.
content_class any nil Extra classes merged onto the content region.
dismiss_label string "Dismiss notice" Accessible label for the notice dismiss control.
dismissed boolean false Server-owned notice dismissal state.
home string nil When set, a leading home-icon crumb links here (`layout="strip"` keeps it when folding).
home_label string "Home" Accessible name for the home crumb.
home_title string nil Tooltip for the home crumb.
id* string — Stable id for the page shell and action hook.
layout stacked | strip "stacked" `"stacked"` (default): a breadcrumb topline above a floating action row. `"strip"`: one solid row with the trail on the left and the actions on the right.
more_actions_label string "More actions" Accessible label for the overflow action menu.
more_breadcrumbs_label string "More breadcrumbs" Accessible label for the strip's folded breadcrumb menu (`layout="strip"`).
notice map nil Optional dismissible notice descriptor.
on_dismiss string nil LiveView event for notice dismissal.
title* string — Current page label and semantic h1 text.
Slots
:inner_block* Page content.