howdy/ui/blocks/app_shell
An application shell: a sidebar of navigation, a top bar with the page heading and actions, and the page’s content.
use state <- cookie.string_or(ctx, "sidebar", default: "expanded")
app_shell.app_shell(
app: "Acme",
collapsed: state == "collapsed",
current: "/orders",
navigation: [
app_shell.Group("Workspace", [
app_shell.Link("/", "Dashboard"),
app_shell.Link("/orders", "Orders"),
]),
],
footer: [text("ada@example.com")],
heading: "Orders",
actions: [ui.theme_toggle([text("Theme")], from: "light", to: "dark")],
content: [orders_table],
)
The sidebar collapses on wide screens and opens over the page on narrow
ones; see howdy/ui/sidebar.
Types
Values
pub fn app_shell(
app app: String,
collapsed collapsed: Bool,
current current: String,
navigation navigation: List(Group),
footer footer: List(element.Element(msg)),
heading heading: String,
actions actions: List(element.Element(msg)),
content content: List(element.Element(msg)),
) -> element.Element(msg)
pub fn content_class() -> css.Class
pub fn group_class() -> css.Class
pub fn heading_class() -> css.Class