Skip to content
Focsd homeFocsd homeFocsd
Forms

App shell

Lays out a header, sidebar, main content and footer for a whole app, with a skip link, and moves the sidebar into a drawer on narrow screens.

  • Tag: focsd-app-shell
  • Pattern: Landmarks grid + skip link + drawer below a width
  • Category: Layout

Example

HTML
<focsd-app-shell nav-label="Workspace">
<focsd-header slot="header" collapse-below="0"
><a href="#" slot="brand">Northwind</a></focsd-header
>
<focsd-sidebar slot="sidebar" label="Workspace">
<focsd-sidebar-item href="#" icon="menu" current>Projects</focsd-sidebar-item>
<focsd-sidebar-item href="#" icon="search">Reports</focsd-sidebar-item>
<focsd-sidebar-item href="#" icon="settings">Settings</focsd-sidebar-item>
</focsd-sidebar>
<h1>Projects</h1>
<p>Twelve projects, three due this week.</p>
<focsd-footer slot="footer"><p>© 2026 Northwind</p></focsd-footer>
</focsd-app-shell>

Usage

Import the module once, then use the tag like any HTML element. Every framework below renders the same element; see Frameworks for setup.

<script type="module">
import '@focsd-dev/components/focsd-app-shell.js';
</script>
<focsd-app-shell nav-label="Workspace">…</focsd-app-shell>

API

Attributes

AttributePropertyTypeDefault
collapse-belowcollapseBelownumber768
nav-labelnavLabelstring—
compactcompactbooleanfalse

Slots

SlotDescription
headerThe page header, usually a focsd-header.
sidebarThe navigation, usually a focsd-sidebar. It moves into the drawer when compact.
(default)The main content.
footerThe page footer, usually a focsd-footer.

CSS parts

Style the inside of the component with ::part(), for example focsd-app-shell::part(skip-link).

PartDescription
skip-linkThe "Skip to main content" link, visible only while focused.
gridThe grid holding header, sidebar, main and footer.
headerThe header row (menu button and header slot).
sidebarThe sidebar column (wide only).
mainThe scrolling main region.
footerThe footer row.
nav-toggleThe menu button that opens the drawer (compact only).
drawerThe navigation drawer, a modal dialog (compact only).
drawer-closeThe drawer's close button.

Accessibility

  • The shell renders the page's one main landmark around its default slot; the header and footer keep their own banner and contentinfo landmarks, and the sidebar its navigation landmark.
  • The first Tab stop is a "Skip to main content" link, hidden until focused. It moves focus to main.
  • main scrolls on its own while the header and footer stay put. It is a tab stop, so keyboard users can scroll it even when it holds no links.
  • Below collapse-below (768 pixels by default) the sidebar moves into a modal dialog named by nav-label, opened by an "Open navigation" button before the header. Escape, the close button or following a link closes it, and focus returns to the button.
  • Put the content straight in the default slot: a <main> inside the shell would be a second main landmark, and the shell warns about it in the console.
  • Right-to-left pages put the sidebar, and the drawer, on the right.

Keyboard

KeyAction
TabThe skip link first, then the header, sidebar, main and footer
EnterOn the skip link: move focus to the main content
EscapeClose the navigation drawer