# Layout and panes

Source: /tuil/docs/reference/components/layout
Locale: en

Build capability-aware rows, columns, bounded containers, split panes, and keyboard-resizable regions.





## Overview [#overview]

Build capability-aware rows, columns, bounded containers, split panes, and keyboard-resizable regions.

## Installation [#installation]

<CodeBlockTabs defaultValue="npm">
  <CodeBlockTabsList>
    <CodeBlockTabsTrigger value="npm">
      npm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="pnpm">
      pnpm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="yarn">
      yarn
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="bun">
      bun
    </CodeBlockTabsTrigger>
  </CodeBlockTabsList>

  <CodeBlockTab value="npm">
    ```bash
    npx @mwillbanks/tuil add box container stack split-pane header footer sidebar pane-tabs scroll-area resizable-pane
    ```
  </CodeBlockTab>

  <CodeBlockTab value="pnpm">
    ```bash
    pnpm dlx @mwillbanks/tuil add box container stack split-pane header footer sidebar pane-tabs scroll-area resizable-pane
    ```
  </CodeBlockTab>

  <CodeBlockTab value="yarn">
    ```bash
    yarn dlx @mwillbanks/tuil add box container stack split-pane header footer sidebar pane-tabs scroll-area resizable-pane
    ```
  </CodeBlockTab>

  <CodeBlockTab value="bun">
    ```bash
    bun x @mwillbanks/tuil add box container stack split-pane header footer sidebar pane-tabs scroll-area resizable-pane
    ```
  </CodeBlockTab>
</CodeBlockTabs>

The CLI writes source-owned components beneath the destination configured in
`tuil.config.ts`; the default import below assumes `src/components/tuil`.

<PublishedStory storyId="component-acceptance" variant="Box" />

## Components and subcomponents [#components-and-subcomponents]

| API                                                                 | Signature                | Description                    |
| ------------------------------------------------------------------- | ------------------------ | ------------------------------ |
| [`Box`](/tuil/docs/reference/components/layout/box)                      | `function Box`           | Public function Box.           |
| [`Container`](/tuil/docs/reference/components/layout/container)          | `function Container`     | Public function Container.     |
| [`Stack`](/tuil/docs/reference/components/layout/stack)                  | `function Stack`         | Public function Stack.         |
| [`HStack`](/tuil/docs/reference/components/layout/hstack)                | `function HStack`        | Public function HStack.        |
| [`VStack`](/tuil/docs/reference/components/layout/vstack)                | `function VStack`        | Public function VStack.        |
| [`Pane`](/tuil/docs/reference/components/layout/pane)                    | `component Pane`         | Public component Pane.         |
| [`SplitPane`](/tuil/docs/reference/components/layout/split-pane)         | `function SplitPane`     | Public function SplitPane.     |
| [`Header`](/tuil/docs/reference/components/layout/header)                | `constant Header`        | Public constant Header.        |
| [`Footer`](/tuil/docs/reference/components/layout/footer)                | `constant Footer`        | Public constant Footer.        |
| [`Sidebar`](/tuil/docs/reference/components/layout/sidebar)              | `constant Sidebar`       | Public constant Sidebar.       |
| [`PaneTabs`](/tuil/docs/reference/components/layout/pane-tabs)           | `function PaneTabs`      | Public function PaneTabs.      |
| [`ScrollArea`](/tuil/docs/reference/components/layout/scroll-area)       | `function ScrollArea`    | Public function ScrollArea.    |
| [`ResizablePane`](/tuil/docs/reference/components/layout/resizable-pane) | `function ResizablePane` | Public function ResizablePane. |

## Interaction [#interaction]

Resizable panes consume scoped arrow-key input while passive layout primitives only project Ink layout props.

## API and events [#api-and-events]

`ResizablePane` reports size changes through `onSizeChange`; other layout components are passive.

Every interactive component publishes semantic roles, labels, state, and focus
identity through the renderer's `SemanticRegistry`. Callback failures flow to
the owning application's error boundary.

<Mermaid
  chart="flowchart LR
  S0[&#x22;props and runtime state&#x22;]
  S1[&#x22;semantic registration&#x22;]
  S2[&#x22;focus and input routing&#x22;]
  S3[&#x22;callback or state update&#x22;]
  S4[&#x22;rerender&#x22;]
  S0 --> S1
  S1 --> S2
  S2 --> S3
  S3 --> S4"
/>

## Example [#example]

```tsx
import type { ComponentProps } from "react";
import { Box } from "@/components/tuil/primitives/box";

export function Example(props: ComponentProps<typeof Box>) {
  return <Box {...props} />;
}
```

Registry-installed components are source-owned: customize the generated file in
your application, and use the package reference for the shared runtime contracts.
