App shell

The frame of an app (Mantine's AppShell): header, navbar, main, aside and footer on wide screens; on phones one column with a bottom bar. The main content scrolls, the bars stay.

Source on GitHub

One app, three widths
phone layout: app bar, content, bottom nav

The app is a page of its own (open it) in an iframe: its drawers, menus and sheets open inside the device, and the shell picks its layout from the frame's width.

Code

In a raylang app

In a std/ui window opened as full_content (the page under a transparent title bar, macOS), with the native bridge, the header becomes the title bar: at least as tall, with room for the window buttons, and dragging it moves the window (buttons in it stay buttons). With layout="alt" or without a header, the navbar and the main content start below the title bar.

var o = ui.options(1100, 720);
o.kind = "full_content";
let h = ui.open_with("Builds", "ray://app/index.html", o)?;

The bridge also keeps the window's background and title bar in the theme's background, so switching to dark, resizing or reopening never flashes the other theme.

API

For AI agents: this API as Markdown, or every component in llms-full.txt.

<ray-app-shell> · RayAppShell

The layout follows the shell's own width (a phone-sized frame shows the phone layout). Below breakpoint the navbar and the aside take no room (a ray-sidebar there still opens as its drawer) and the bottom slot shows. It fills the window's height (100dvh) unless sized. In a std/ui full_content window (ray-elements/core/raylang.js) the header becomes the title bar: room for the window buttons, and it drags the window; with layout="alt" or no header, the navbar and main start below it.

PropertyAttributeTypeDefaultDescription
layoutlayout reflectsdefault | altdefaultdefault: the header across the top; alt: the navbar full height, the header beside it.
breakpointbreakpointstring48emWidth (px, em or rem) below which it takes the phone layout.
paddingpadding reflectsstringPadding of the main area: xs…xl, a number (px) or a CSS length.
EventDescription
ray-breakpointIt switched between the wide and the phone layout.
SlotDescription
(default)The main content (it scrolls).
headerTop bar: a ray-app-bar or a header of your own.
navbarSide navigation (a ray-sidebar). Wide screens only.
asideA panel on the other side (details, an inspector). Wide screens only.
footerUnder the main content.
bottomPhones only: a ray-bottom-nav.
PartDescription
shellThe grid.
headerThe header area.
navbarThe navbar area.
mainThe scrolling main area.
asideThe aside area.
footerThe footer area.
bottomThe bottom bar area.