# WorkspaceShell

A full app frame with header, navigation, content, inspector and footer areas that adapts to screen size.

- **Use it for**: A full app frame with header, navigation, content, inspector and footer.
- **Not for**: Single content pages. Try [SplitPane](https://unseenui.com/components/split-pane/).

## Good to know

- Scrolling panes keep 4px of padding and room for a scrollbar. When a pane’s content scrolls itself (a chat, a sidebar list), set `--ai-workspace-pane-padding: 0` and `--ai-workspace-pane-gutter: auto`.

## Installation

```bash
npm install @stackunseen/ui
```

## Parts

The frame of an app screen. It only lays out the slots you fill; routing, access and state stay with your app, and each slot mounts once.

1. **Header**: Across the whole workspace, or above the main area only with `headerPlacement="main"` so navigation runs full height, as in chat apps. Props: `header`, `headerLabel`, `headerPlacement`.
2. **Navigation**: Stacks on narrow screens. In responsive mode it gets a toggle: it collapses on wide screens and becomes a drawer on narrow ones. Props: `navigation`, `navigationLabel`, `navigationMode`, `navigationOpen`, `onNavigationOpenChange`, `navigationBreakpoint`, `navigationToggleLabel`.
3. **Main**: Your content. Use `mainAs="section"` inside a page that already has a main landmark; `scrollMode="panes"` gives each column its own scroll in a fixed-height host. Props: `main`, `mainLabel`, `mainAs`, `scrollMode`.
4. **Inspector**: Optional details beside the main area, such as the selected item. Props: `inspector`, `inspectorLabel`, `inspectorAs`.
5. **Footer**: Optional status or actions along the bottom. Props: `footer`, `footerLabel`.

## Usage

```tsx
import { WorkspaceShell } from '@stackunseen/ui/workspace';
import '@stackunseen/ui/styles.css';

<WorkspaceShell variant="workspace" label="Project workspace" mainAs="section" header={header} navigation={navigation} main={content} inspector={inspector} />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `footer` | `ReactNode` |  |
| `footerLabel` | `string` |  |
| `header` | `ReactNode` |  |
| `headerLabel` | `string` |  |
| `headerPlacement` | `"main" \| "span"` | "span" (default) puts the header across the whole workspace. |
| `inspector` | `ReactNode` |  |
| `inspectorAs` | `"aside" \| "div"` | Use div when the supplied inspector already owns its aside/dialog semantics. |
| `inspectorLabel` | `string` |  |
| `label` | `string` | Named workspace landmark, independent of the host application's title. |
| `main` (required) | `ReactNode` |  |
| `mainAs` | `"main" \| "section"` | Use section when the workspace is embedded inside an existing main landmark. |
| `mainLabel` | `string` |  |
| `navigation` | `ReactNode` |  |
| `navigationBreakpoint` | `number` | Responsive mode: below this width (px) the navigation becomes a drawer. |
| `navigationLabel` | `string` |  |
| `navigationMode` | `"inline" \| "responsive"` | "inline" (default) keeps navigation in the layout and stacks it on narrow widths. |
| `navigationOpen` | `boolean` | Responsive mode: whether navigation shows. |
| `navigationToggleLabel` | `string` | Accessible name of the navigation toggle. |
| `onNavigationOpenChange` | `((open: boolean) => void)` |  |
| `scrollMode` | `"flow" \| "panes"` | Panes requires a bounded host height. |
| `variant` | `"compact" \| "workspace" \| "contained"` |  |

## Keyboard

Slot controls retain document Tab order. Flow mode shares page scrolling; panes mode requires a bounded height and named reading regions. In responsive mode the toggle reports aria-expanded; a narrow drawer takes focus, closes on Escape, the scrim or a followed link, and returns focus to the toggle.

## Works with

[Sidecar](https://unseenui.com/components/sidecar/), [SplitPane](https://unseenui.com/components/split-pane/)

Page: https://unseenui.com/components/workspace-shell/
