The framed shell of the app with the side menu of sidebar/1: the menu on the grey frame and the
page beside it. It is fed by one list of items, so changing sidebar changes the menu and not the
items.
<.shell nav={MyAppWeb.Nav.items(assigns)} sidebar="rail" current={@current_path}
brand={%{name: "Ledger", logo: "S"}} user={@user}>
<:topbar><.navbar>...</.navbar></:topbar>
...the page...
</.shell>nav, brand, user, plan, trial, rail_extra, footer, version, match,
persist_groups, collapsible and collapsed are those of LedgerUI.Components.Sidebar.sidebar/1,
which documents the data of the items. sidebar is the format (sections, rail, tree or
nested).
The :topbar slot is the row at the top of the page (a navbar/1), the :tab_bar slot is the
phone's bottom bar of tabs (a tab_bar/1, shown only below 768px by the LedgerUI.AppShell
hook stylesheet).
Preview
variant="preview" draws the canvas wireframe of a layout instead of the app (the docs and the
showcase use it): sidebar, minimal, sideblock, horizontal, framed or rail. A box with
grey bars for the menu, the top bar and the cards; class takes the animation (m-collapse).
<.shell variant="preview" layout="framed" class="m-collapse" />Configuration
config :ledger_ui, :shell, sidebar: :sections, nav: {MyAppWeb.Nav, :items}, footer: :version, version: "v1.4.2"Attributes always win over the config.
Summary
Functions
Attributes
id(:string) - Defaults to"shell".variant(:string) - Defaults to"app". Must be one of"app", or"preview".layout(:string) - Withpreview: the wireframe. Defaults to"sidebar". Must be one of"sidebar","minimal","sideblock","horizontal","framed", or"rail".flat(:boolean) - The items of the menu without the column around them. Defaults tofalse.sidebar(:any) - Defaults tonil.nav(:list) - Defaults tonil.current(:string) - Defaults tonil.brand(:map) - Defaults tonil.user(:map) - Defaults tonil.footer(:any) - Defaults tonil.show_user(:boolean) - Defaults tonil.version(:any) - Defaults tonil.match(:string) - Defaults to"exact". Must be one of"exact", or"prefix".persist_groups(:boolean) - Defaults tofalse.plan(:map) - Defaults tonil.trial(:map) - Defaults tonil.rail_extra(:list) - Defaults to[].collapsible(:boolean) - Defaults totrue.collapsed(:boolean) - Defaults tofalse.class(:any) - Defaults tonil.main_class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
brand_markinner_blockmobile_drawersidebar_footertab_bartopbar