# Focus Frame

> One frame for a group, gliding to what you point at.

It follows hover and keyboard focus across items and settles back on the current one. Nav bars, options and grids feel connected.

- 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/focus-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 focus-frame
```

It installs to `components/galactrex/focus-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 { FocusFrame } from "@/components/galactrex/focus-frame";

<FocusFrame look="fill"><a aria-current="page">Home</a><a>Work</a></FocusFrame>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | — | Items: direct children or [data-focus-item]. |
| `look` | `"outline" \| "fill" \| "underline"` | `"outline"` | Frame style. |
| `restOn` | `string` | — | Selector of the current item to rest on. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Nav.** Fill behind links, resting on aria-current.
- **Grid.** Outline gliding over cards.

## Accessibility

- Follows keyboard focus; the frame is decorative.

## Motion

- One spring-animated box.
- Reduced motion: jumps.
