[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/admin](../../README) / [index](../README) / AdminLayout

# Class: AdminLayout

Defined in: [admin/src/ui/AdminLayout.tsx:18](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/ui/AdminLayout.tsx#L18)

Base class for Flow page layouts — persistent shell UI wrapped around page content.

## Remarks

A layout wraps page content with shell UI (nav, sidebars, footers) that outlives page
navigation. On `flow:navigate`, pages that share the same layout class only swap their
`[data-flow-root]` content; the layout shell stays mounted and is never re-rendered or
re-sent over the socket. Attach one with `static layout = AppLayout` on a [Component](../../../flow/index/classes/Component)
(or override [Component.layout](../../../flow/index/classes/Component#layout) for the JSX-native form).

## Example

```tsx
export class AppLayout extends Layout {
  static head = `<link rel="stylesheet" href="/app.css">`;

  render(slot: HtmlNode) {
    return (
      <div>
        <nav>
          <a href="/dashboard" flow:navigate>Dashboard</a>
        </nav>
        <main>{slot}</main>
      </div>
    );
  }
}

export class DashboardPage extends Component {
  static layout = AppLayout;
}
```

## Extends

- [`Layout`](../../../flow/index/classes/Layout)

## Constructors

### Constructor

> **new AdminLayout**(): `AdminLayout`

#### Returns

`AdminLayout`

#### Inherited from

[`Layout`](../../../flow/index/classes/Layout).[`constructor`](../../../flow/index/classes/Layout#constructor)

## Properties

### panel

> `static` **panel**: [`PanelInstance`](PanelInstance) \| `undefined`

Defined in: [admin/src/ui/AdminLayout.tsx:24](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/ui/AdminLayout.tsx#L24)

The panel this shell belongs to. The base class serves whichever panel owns
the request; [makeAdminLayout](../functions/makeAdminLayout) binds a specific one, which is what
every generated page uses so a WebSocket action can't drift to a sibling.

## Accessors

### head

#### Get Signature

> **get** `static` **head**(): `string`

Defined in: [admin/src/ui/AdminLayout.tsx:33](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/ui/AdminLayout.tsx#L33)

Extra HTML injected into `<head>` (stylesheets, fonts, global meta tags).

##### Returns

`string`

Extra HTML injected into `<head>` (stylesheets, fonts, global meta tags).

#### Overrides

[`Layout`](../../../flow/index/classes/Layout).[`head`](../../../flow/index/classes/Layout#head)

## Methods

### panel()

> `protected` **panel**(): [`PanelInstance`](PanelInstance)

Defined in: [admin/src/ui/AdminLayout.tsx:27](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/ui/AdminLayout.tsx#L27)

The bound panel, or the one owning the current request.

#### Returns

[`PanelInstance`](PanelInstance)

***

### render()

> **render**(`slot`): `Promise`\<[`HtmlNode`](../../../flow/index/type-aliases/HtmlNode)\>

Defined in: [admin/src/ui/AdminLayout.tsx:38](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/ui/AdminLayout.tsx#L38)

Render the layout shell around a page.

#### Parameters

##### slot

[`HtmlNode`](../../../flow/index/type-aliases/HtmlNode)

the page's pre-rendered `[data-flow-root]` component node. Place it with
  `{slot}` in JSX — its HTML is emitted verbatim without escaping.

#### Returns

`Promise`\<[`HtmlNode`](../../../flow/index/type-aliases/HtmlNode)\>

the shell markup wrapping `slot`.

#### Overrides

[`Layout`](../../../flow/index/classes/Layout).[`render`](../../../flow/index/classes/Layout#render)
