# Window Frame

> A desktop window you can drag and roll up.

Title bar to drag it by, a roll-up button and a close button you handle. For working product shots and playful desktop pages.

- Family: Chrome
- Plan: Creative. Included with Creative.
- Requires: React, Tailwind CSS v4 and the motion package
- Page with a live preview: https://galactrex.com/ui/window-frame/
- Licence: https://galactrex.com/ui/license/

## Install

```sh
npx @galactrex/ui login   # once, with an API key from https://galactrex.com/account/
npx @galactrex/ui add window-frame
```

It installs to `components/galactrex/window-frame.tsx`, with the shared motion helpers beside it. First time in a project: `npx @galactrex/ui init` (setup guide: https://galactrex.com/docs/ui-components-setup/).

## Usage

```tsx
import { WindowFrame } from "@/components/galactrex/window-frame";

<WindowFrame title="Notes.txt" onClose={close}>…</WindowFrame>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | — | Content. |
| `title` | `string` | — | Window title. |
| `draggable` | `boolean` | `true` | Drag by the title bar. |
| `collapsible` | `boolean` | `true` | Roll-up button. |
| `onClose` | `() => void` | — | Shows a close button. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Desktop.** Several windows on a page.

## Accessibility

- A labelled section; title bar buttons are real buttons with names.

## Motion

- Height spring for roll-up; drag without momentum.
- Reduced motion: no height animation.
