Pure Admin's layout system: navbar + sidebar + content + footer with configurable behavior

Layout Structure

The three-level nesting pattern

html

    <.layout>
      <.navbar>
        <:start>...</:start>
        <:center>...</:center>
        <:end_>...</:end_>
      </.navbar>

      <.layout_inner>
        <.sidebar>
          <.sidebar_item label="Dashboard" icon="..." href="/" />
          <.sidebar_submenu id="settings" label="Settings" icon="...">
            <.sidebar_item label="General" href="/settings" />
          </.sidebar_submenu>
        </.sidebar>

        <.layout_content>
          <.main>content</.main>
          <.footer>
            <:start>...</:start>
            <:end_>...</:end_>
          </.footer>
        </.layout_content>
      </.layout_inner>
    </.layout>
  

Layout CSS Classes

ClassDescription
.pa-layout Root layout container (100vh flex column)
.pa-layout__inner Content area below navbar (flex row)
.pa-layout__sidebar Sidebar container (fixed width)
.pa-layout__sidebar--icon-collapse Sidebar shows icons only when collapsed
.pa-layout__sidebar--resizable Enable drag-to-resize sidebar
.pa-layout__content Main content + footer wrapper (flex grow)
.pa-layout--sticky Sticky sidebar (doesn't scroll with content)

Navbar Structure

ClassDescription
.pa-navbar Top navigation bar (3-section flex layout)
.pa-navbar__start Left section: burger + brand + nav items
.pa-navbar__center Center section: page title
.pa-navbar__end Right section: nav + notifications + profile
.pa-navbar__brand Brand/logo container
.pa-navbar__nav Navigation link group
.pa-navbar__nav-item Individual nav link
.pa-navbar__dropdown CSS dropdown menu
.pa-navbar__title Page title in center section

Sidebar Components

LiveView Components

  • <.sidebar> - Sidebar container with optional id
  • <.sidebar_item> - Link item with label, icon, href, is_active
  • <.sidebar_submenu> - Expandable group with id, label, icon, is_open

Sidebar Behavior

  • Hide - sidebar-hidden on body hides completely
  • Icon collapse - pa-layout__sidebar--icon-collapse shows icons only
  • Resizable - pa-layout__sidebar--resizable enables drag handle
  • Sticky - pa-layout--sticky on body fixes sidebar position
  • Submenu persistence - PureAdminSidebarSubmenu hook saves open/closed state to localStorage

Container Width

Control the maximum width of the content area

ClassMax WidthDescription
.(none) 100% Fluid - full width (default)
.pa-container-sm 768px Small
.pa-container-md 1024px Medium
.pa-container-lg 1280px Large
.pa-container-xl 1600px Extra large
.pa-container-2xl 1920px 2X large
Apply container width classes to <body>. The settings panel manages this automatically via localStorage.

John Doe

Administrator

Settings

Sidebar
Display
Profile Panel
Body text size. All elements scale proportionally.