Docs shell
A documentation layout: sidebar, page and an "On this page" column, with a menu on phones.
Usage
After the one-time setup, call the helper directly from ERB. No component import is needed.
<% navigation = lc_nav_list label: "Guides" do |nav| %>
<%= nav.link "Introduction", "#", current: true %>
<%= nav.link "Install", "#" %>
<% end %>
<% contents = lc_toc { |toc| toc.link "Requirements", "#requirements" } %>
<%= lc_docs_shell navigation:, contents:, menu_label: "Guides", class: "px-0 sm:px-0 lg:px-0", main: { id: nil } do %>
<%= lc_section title: "Requirements", id: "requirements", anchor: true do %>
<%= lc_text "An account with owner access.", size: :small, tone: :muted %>
<% end %>
<% end %>
Examples
Documentation page
Requirements
An account with owner access.
<% navigation = lc_nav_list label: "Guides" do |nav| %>
<%= nav.link "Introduction", "#", current: true %>
<%= nav.link "Install", "#" %>
<% end %>
<% contents = lc_toc { |toc| toc.link "Requirements", "#requirements" } %>
<%= lc_docs_shell navigation:, contents:, menu_label: "Guides", class: "px-0 sm:px-0 lg:px-0", main: { id: nil } do %>
<%= lc_section title: "Requirements", id: "requirements", anchor: true do %>
<%= lc_text "An account with owner access.", size: :small, tone: :muted %>
<% end %>
<% end %>
API reference
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_docs_shell
lc_docs_shell(navigation:, contents: nil, menu_label: lc_t("lostcoords.ui.docs_shell.menu"), sidebar_label: lc_t("lostcoords.ui.docs_shell.sidebar"), main: {}, **attributes, &block)
| Input | Default | Values |
|---|---|---|
| navigation | Required | — |
| contents | nil | — |
| menu_label | lc_t("lostcoords.ui.docs_shell.menu") | — |
| sidebar_label | lc_t("lostcoords.ui.docs_shell.sidebar") | — |
| main | {} | — |
| attributes | {} | Native HTML attributes; class:, data: and aria: merge with defaults |
| block | Captured block | Captured Rails ERB content |
The examples also use lc_nav_list, lc_toc, lc_section, and lc_text. 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.