aster.UI / Docs
Aster products
Showcase ↗

Aster UI / Guides

Choose an app shell

An application built with Aster UI usually runs in two places: in a browser tab, and as an installed app (a Tauri window or an installed web app). The shell is the outermost layout that holds the app's header and its workspace. Aster supports two shells, and an app can use both.

Both shells hold the same screens, data, actions and view choices. The shell changes presentation only, so never put a feature in one and not the other.

Open the example: one device screen with tiles and a list. Its Shell choice switches between Automatic, Plain and Window so you can compare them on one screen.

When to use each

Use plain when:

Use the window shell, in addition to plain, when the app also ships installed and you want its browser tab to look like the installed app, or when the page backdrop, such as the Lamplight theme's, is part of the presentation.

If you are unsure, use plain. When you describe the choice to a person, show both on the same screen, with the same data, and let them pick.

What both shells share

html, body { height: 100%; }
body {
  box-sizing: border-box;
  margin: 0;
  padding: var(--app-frame-block, 0) var(--app-frame-inline, 0);
  background: var(--aster-page);
}
.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);  /* header, workspace */
  box-sizing: border-box;
  height: 100%;
  overflow: hidden;
  border: var(--app-frame-border, 0);
  border-radius: var(--app-frame-radius, 0);
  background: var(--aster-surface);
  box-shadow: var(--app-frame-shadow, none);
}
.workspace { display: flex; flex-direction: column; min-height: 0; }
.content { flex: 1; min-height: 0; overflow: auto; }
/* A grid fills the content area and scrolls its own rows. */
.content:has(> aster-grid) { display: flex; flex-direction: column; overflow: hidden; }
.content > aster-grid { flex: 1; min-height: 0; }

The frame spacing is padding on body, not a margin on the shell, so it cannot collapse into the page and make the document scroll.

Add the window shell

The window shell is the plain shell plus a few variables, set by one media query. Without them, every frame value falls back to edge to edge.

@media (display-mode: browser) and (pointer: fine) and (min-width: 900px) and (min-height: 540px) {
  :root {
    --app-frame-inline: clamp(16px, 2.2vw, 28px);
    --app-frame-block: 18px;
    --app-frame-border: 1px solid var(--aster-rule);
    --app-frame-radius: var(--aster-r-dialog);
    --app-frame-shadow: var(--aster-e2);
  }
}

Each condition does a job:

Use theme tokens for the frame, as above, so it follows the theme and the light or dark scheme.

The pattern and the example's choices

These are the pattern: one document for both shells; a frame drawn only by CSS, under a media query on display mode, pointer and size; a fixed header and heading over a scrolling content area; and the same content in both.

These are the example's own choices, to adjust for your app: the 900 × 540 thresholds, the inset sizes, the tokens chosen for the frame, and the Shell choice with its ?shell= parameter. An application chooses its shell with the media query, not with a setting.

Overlays in the window shell

Dialogs, menus, pickers and toasts are placed against the viewport, not the frame. A modal dialog dims the whole page, including the space around the frame. Toasts appear near the bottom of the viewport, which puts them over the frame's lower edge. Menus and pickers open against their anchors, so they stay beside the control that opened them.

Don't set --aster-host-inset-* to the frame spacing to pull overlays inside the frame. A host inset replaces the measured edge, including the on-screen keyboard's height.

What Aster does not provide

Aster has no shell element or class, so the shell CSS above belongs to your application. Copy it from the example and adjust the values.

Where to go next

Run in Tauri and installed web apps covers title bars, screen edges and the on-screen keyboard in an installed shell.