<!-- Generated by scripts/gen-docs.mts from the JSDoc in registry/. Do not edit; run `pnpm run docs`. -->

# PaneHeader

The one header at the top of a pane (a chat, a folder's list, a calendar, a feed, a side pane): a title, the pane's own controls and its actions on one row, with the actions pinned to the end.

## Install

Once per app, with Tailwind CSS v4 and an `@/*` path alias (skip `init` in an existing shadcn app), then the component:

```sh
npx shadcn@latest init --base base --preset nova --yes --no-monorepo
npx shadcn@latest add ourostack/ouro-ui/ouro-base#v1.3.823
npx shadcn@latest add ourostack/ouro-ui/pane-header#v1.3.823
```

More: [Installing](https://ui.ouroboros.bot/docs/installing.md).

```tsx
import { PaneHeader } from "@/components/ouro/pane-header/pane-header";
```

## Example

```tsx
<PaneHeader title={<Heading level={2}>Calendar</Heading>} controls={<Button variant="plain">Today</Button>} actions={<Button>New event</Button>} />
```

## Use instead when

- Use `PageHeader` instead for the top of a whole page, `ChatHeader` for an open chat's people, and `Toolbar` for a row of controls with no title.

## Props

Type: `PaneHeaderProps`.

| Prop | Type | Description |
| --- | --- | --- |
| `actions` | `ReactNode` | What a person does here, such as a call or a menu button, pinned to the end. |
| `children` | `ReactNode` | More in the row, after the controls and before the actions. |
| `className` | `string` | Layout only: margins, padding, width (`px-4 py-2`). Appearance classes warn in development. |
| `controls` | `ReactNode` | The pane's own controls, such as a filter or a view switch, after the title. |
| `ref` | `Ref<HTMLElement>` | Reaches the rendered element. |
| `title` | `ReactNode` | What the pane is: its name, at the start. |

## Native attributes

Also accepts the attributes in React's `HTMLAttributes` (`id`, `aria-*`, event handlers), passed to the rendered element, except those named on this page.

## Don't use

These are not props. Passing one fails the type check with the fix in the error, and in development a console message names the fix.

- `action`: Not a prop. The buttons at the end are `actions`: `<PaneHeader actions={<Button>New</Button>} />`.
- `heading`: Not a prop. The pane's name is `title`: `<PaneHeader title="Calendar" />`.

## `className` is for layout only

Pass margins, width and grid placement (`mt-4`, `w-full`, `col-span-2`).

Appearance comes from props, not classes. In development, a class that sets appearance logs one warning per component instance, naming the prop to use instead. A class sets appearance when, after its variants (`hover:`, `sm:`) and any `!` are removed, it starts with `bg-`, `text-`, `border-`, `rounded-`, `shadow-`, `font-`, `ring-`, `from-`, `via-`, `to-`, `fill-` or `stroke-`, or is `border`, `rounded`, `shadow` or `ring`, or has a `dark:` variant. Text wrapping, overflow and table layout classes (`text-wrap`, `text-ellipsis`, `border-collapse`) are layout and do not warn.

Alignment classes (`text-center`) warn too: set alignment on a parent element.
