Skip to content

AppShell

Stable

The outer frame of a screen: a narrow side panel and one main area.

Also known as layout, app layout, sidebar layout, scaffold

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Side panel and main area

Main content goes here.

The frame fills the space around it, so give that space a height. Make the window narrow and the side panel disappears.

When to use it

The frame around every screen: a narrow side panel for navigation and one main area for the work. The side panel stays narrow so it never competes with the main area.

Made of: Side panel · Main area

Use it for

  • The outer frame of any app screen.
  • A screen with past chats or navigation in a side panel.
  • A full-width screen with no side panel: leave rail out.

Not for

  • Splitting the main area into chat and work side by side: use SplitCanvasTemplate.
  • Spacing content inside a section: use Stack.

Do and avoid

Chats

Trips

Lisbon trip

Do. Sketch: the main button sits in the main area, seen on every screen.

Chats

Trips

Lisbon trip

Avoid. The only Book button sits in the side panel, hidden on phones.

Do

  • Put navigation and the user card in the side panel so the main area stays calm.
  • Give the frame a space with a set height.
  • Put a template (HomeTemplate, ThreadTemplate) inside it.
  • Check how it looks without the side panel, since it is hidden on small screens.

Avoid

  • Do not put important actions only in the side panel. It is hidden on narrow screens.
  • Do not add a third column. Use SplitCanvasTemplate inside the main area instead.
  • Do not put an AppShell inside another AppShell.

On a phone

  • Below the md breakpoint the sidebar moves into a side sheet that opens from a Menu button above the main area. Use menuLabel to rename that button.
  • The main area takes the full width and can shrink without overflowing.
  • The shell is as tall as its parent, so give the parent a height; use the dynamic viewport height so phone browser bars are counted.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started