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

# AppWindow

A live piece of interface framed as an application's window: a title bar with a label (such as the file the demo lives in) and actions at its end, the working content inside, and the Ouro HX components it is built from along its foot. Its edge is a real border, so it holds in forced colours.

## 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.344
npx shadcn@latest add ourostack/ouro-ui/app-window#v1.3.344
```

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

```tsx
import { AppWindow } from "@/components/ouro/app-window/app-window";
```

## Example

```tsx
<AppWindow title="tea.tsx" actions={<Button variant="plain" size="sm">Code</Button>} builtWith={["Checklist", "Button"]}>
  <TeaSteps />
</AppWindow>
```

## Use instead when

- Use `Card` instead when the content is a card in your own interface, not a demo of one, and `CodeBlock` instead to show the code rather than the working interface.

## Props

Type: `AppWindowProps`.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `actions` | `ReactNode` |  | At the end of the title bar, such as a Code button that shows the demo's source. |
| `builtWith` | `readonly string[]` |  | The Ouro HX components the content is built from, each an outline Badge in a list along the window's foot, after the `builtWithLabel`. With none, the window has no foot. |
| `builtWithLabel` | `string` | `"Built with"` | The foot's label, which also names its list, for another language. |
| `children` | `ReactNode` |  | The live content: the working interface the window frames. |
| `className` | `string` |  | Layout only: margins, width (`mt-8`, `max-w-xl`). Appearance classes warn in development. |
| `inset` | `boolean` | `true` | Padding round the content. `false` runs the content edge to edge, for a picture, a map or a chart. |
| `ref` | `Ref<HTMLDivElement>` |  | Reaches the rendered element. |
| `title` (required) | `ReactNode` |  | The title bar's label, such as the file the demo lives in (`tea.tsx`): small, muted and monospace, cut short with an ellipsis when the bar is too narrow. |

## 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.

- `components`: Not a prop. The components are `builtWith`: `<AppWindow builtWith={["Button", "Checklist"]} />`.
- `footer`: Not a prop. The foot lists `builtWith`: `<AppWindow builtWith={["Button", "Checklist"]} />`.
- `label`: Not a prop. The bar's label is `title`: `<AppWindow title="tea.tsx" />`.
- `padded`: Not a prop. The padding is `inset`: `<AppWindow inset={false} />` runs the content edge to edge.
- `uses`: Not a prop. The components are `builtWith`: `<AppWindow builtWith={["Button", "Checklist"]} />`.

## `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.
