app_shell do |shell|
shell.with_banner(text, kind: :test) # or :sandbox
shell.with_sidebar(brand:, brand_href: "/") do |sidebar|
sidebar.with_brand_logo { … }
sidebar.with_item(label, href:, icon: nil, current: nil)
sidebar.with_heading(text)
sidebar.with_footer { … }
end
# page content
end
Use it once, in the application layout, around yield. The banner names any environment that is not the real one (:test yellow, :sandbox violet); real data shows none. Sidebar items mark themselves current with current_page? unless you pass current:; with_heading groups the items after it.
Give html and body height: 100%. Below 760px wide, collapse or move the sidebar in your layout.
DEVELOPMENT DATA — kept separate from live data
Conteúdo da página
<div style="height: 300px; border: 1px solid var(--line)">
<%= app_shell do |shell| %>
<% shell.with_banner "DEVELOPMENT DATA — kept separate from live data" %>
<% shell.with_sidebar(brand: "Workflows") do |sidebar| %>
<% sidebar.with_item "Agenda", href: "#agenda", icon: "calendar", current: true %>
<% sidebar.with_item "Quests", href: "#quests", icon: "target" %>
<% sidebar.with_heading "Negócios" %>
<% sidebar.with_item "Invoices", href: "#invoices", icon: "file-invoice" %>
<% end %>
<%= empty_state "Conteúdo da página" %>
<% end %>
</div>
Slots
| Slot | What goes in it |
|---|---|
banner | EnvBanner: text and kind (:test, :sandbox) |
sidebar | brand, brand_href; with_item, with_heading, with_brand_logo, with_footer |