@molecule/app-shell-layout-solid

Feature · shell-layout · App (browser) · v1.1.0 · Apache-2.0

Top-level app shell layout: header slot + main content + footer slot

npm install @molecule/app-shell-layout-solid

npm · Source on GitHub

How it works

@molecule/app-shell-layout-solid is a ready-made shell-layout feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.

import { AppShellLayout } from '@molecule/app-shell-layout-solid'
import { AppFooter } from '@molecule/app-footer-solid'
import { AppHeader } from '@molecule/app-header-solid'

export function Shell() {
  return (
    <AppShellLayout
      header={<AppHeader appName="Bearing" />}
      footer={<AppFooter appName="Bearing" aboutHref="https://example.com" />}
      maxWidth="xl"
    >
      <main>…routed content…</main>
    </AppShellLayout>
  )
}

Works with: @molecule/app-solid, @molecule/app-ui, @molecule/app-ui-solid

Reference

Solid top-level app shell layout.

Exports AppShellLayout — the Solid counterpart of @molecule/app-shell-layout-react with the same props and the same DOM: header slot + main content (constrained by a Container) + footer slot, with the page frame styled via the ClassMap bond. Apps fill the slots with their own Header, Footer, and route content.

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

Quick Start

import { AppShellLayout } from '@molecule/app-shell-layout-solid'
import { AppFooter } from '@molecule/app-footer-solid'
import { AppHeader } from '@molecule/app-header-solid'

export function Shell() {
  return (
    <AppShellLayout
      header={<AppHeader appName="Bearing" />}
      footer={<AppFooter appName="Bearing" aboutHref="https://example.com" />}
      maxWidth="xl"
    >
      <main>…routed content…</main>
    </AppShellLayout>
  )
}

Type

feature

Installation

npm install @molecule/app-shell-layout-solid @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js

API

Interfaces

AppShellLayoutProps

Props accepted by the AppShellLayout component.

interface AppShellLayoutProps {
  /** Slot for the header (typically the app's `<Header />`). */
  header?: JSX.Element
  /** Slot for the footer (typically the app's `<Footer />`). */
  footer?: JSX.Element
  /** Main content. Pass the router's outlet for routed apps. */
  children: JSX.Element
  /** Container max-width for the main content. Defaults to `'xl'`. */
  maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full' | string
  /** Extra classes on the outer wrapper. */
  className?: string
  /**
   * Extra classes on the inner `<main>` element. Apps that need
   * vertical rhythm around the routed content (e.g. `cm.sp('py', 8)`)
   * pass it here instead of forking the shell. Omitted by default so
   * the `<main>` carries no padding.
   */
  mainClassName?: string
  /** `data-mol-id` for AI-agent selectors. */
  dataMolId?: string
}

Functions

AppShellLayout(props)

Top-level page scaffold: header → main (constrained by Container) → footer.

The page frame uses ClassMap tokens (cm.page, cm.appLayout) so the styling library can be swapped without touching consumers. The header and footer are slot props so consumers retain full control over branding, navigation, and footer copy.

This is the Solid counterpart of @molecule/app-shell-layout-react: the same props (React names), the same ClassMap tokens, and the same DOM for the same input.

function AppShellLayout(props: AppShellLayoutProps): JSX.Element
  • props — Component props (see AppShellLayoutProps).

Returns: The rendered shell layout.

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-solid ^3.5.0
  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-solid ^1.1.0
  • solid-js ^1.8.0

Runtime Dependencies

  • @molecule/app-solid

  • @molecule/app-ui

  • @molecule/app-ui-solid

  • solid-js

  • Requires a bonded ClassMap (frame uses cm.page + cm.appLayout) — rendering throws otherwise. No i18n or router dependency; the routed outlet is just the typical child — any content works.

  • The <main> carries no padding by default — pass mainClassName (e.g. cm.sp('py', 8)) for vertical rhythm around routed content.

  • Header/footer slots render as-is with no positioning — make your header sticky yourself if desired.

  • Sibling: @molecule/app-sidebar-layout-solid is the left-sidebar shell; THIS package is the top header/footer shell.