Skip to Content
TelamonJS

ShellPage

Full-height composable page container with CSS fullscreen support

Full-height container for admin pages, and the root of the composable shell trio: ShellPage + AdminHeader + AdminTabs. Provides a fullscreen toggle (CSS-based, fixed inset-0 z-50, so Radix portals keep working) with an ESC listener, and exposes its state to its children.

import { ShellPage, AdminHeader, AdminTabs } from '@telamonjs/ui'

<ShellPage>
  <AdminHeader title='Alerts' description='Manage alert rules' icon='Bell' />
  <AdminTabs tabs={tabs} value={activeTab} onValueChange={setTab} />
</ShellPage>

Composable pieces

Compose ShellPage + AdminHeader + AdminTabs — independent, reusable pieces optimized for dashboards with tabs, maps, and real-time UIs.


Props

PropTypeDefaultDescription
allowFullscreenbooleantrueEnable the fullscreen toggle
classNamestring-Extra classes on the container
childrenReactNode-Page content (header, tabs, content)

Context

ShellPage provides a context, consumed via the useShellPage hook:

const shell = useShellPage()
// { isFullscreen: boolean, toggleFullscreen: () => void } | null

AdminHeader consumes this context automatically to render its fullscreen button — no wiring needed.


Behavior

  • Fullscreen is pure CSS (fixed inset-0 z-50 h-screen bg-background) — no Fullscreen API, so dialogs and dropdowns rendered in portals keep working.
  • ESC exits fullscreen while active.
  • The container is flex flex-col h-full, so children like AdminTabs (with fillHeight) or ShellContent can fill the remaining viewport.

Pages Without Tabs

For pages without tabs, use ShellContent as the content area:

fullHeightLayoutUse for
true (default)flex-1 min-h-0 overflow-hiddenMaps, viewport-filling content
falseflex-1 overflow-autoNaturally scrolling content

ShellContent also takes padding (default false; adds p-4 lg:p-6) and className.

<ShellPage>
  <AdminHeader title='Live Map' icon='Map' />
  <ShellContent fullHeight>
    <MapComponent />
  </ShellContent>
</ShellPage>

On this page