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

A labelled group of links in the sidebar.

pub type Group {
  Group(label: String, links: List(Link))
}

Constructors

  • Group(label: String, links: List(Link))
pub type Link {
  Link(href: String, label: String)
}

Constructors

  • Link(href: String, label: String)

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 bar_class() -> css.Class
pub fn classes() -> List(css.Class)

Every class this module uses, for howdy/ui/export.

pub fn content_class() -> css.Class
pub fn group_class() -> css.Class
pub fn heading_class() -> css.Class
✨ Search Document