Page

Material Design 3-styled page shell web component (lit-material-page) — a header/sidebar/main content grid.

  • 670 B gzipped
  • @lit-material/page 0.0.3
  • Renders on the server

Example

Install

npm install @lit-material/page @lit-material/tokens
import "@lit-material/page";

Link @lit-material/tokens/css/index.css once per page for the colour, type and shape tokens. Install guide

API

<lit-material-page>

The outermost app-shell grid: a header row spanning the full width, and a sidebar/main-content row below it. A pure layout primitive — it renders whatever's slotted into header/sidebar (typically lit-material-top-app-bar and lit-material-navigation-drawer or -rail) without knowing anything about their specific behavior, so it has no opinion on responsive collapsing, drawer toggling, or the sidebar's width — that's already each of those components' own responsibility, and duplicating it here would just create two sources of truth. main and sidebar scroll independently of each other and of the header, which stays put across both — the usual app-shell scrolling behavior — with no JS required.

Slots

SlotDescription
headerThe page header (masthead).
sidebarPrimary navigation.
defaultThe main content.

CSS parts

PartDescription
headerThe header row's container.
sidebarThe sidebar column's container.
mainThe main content column's container.

Source on GitHub npm