# Animated Corners

> Corner brackets that close into a full frame.

A crisp selection indicator for tiles, thumbnails and level-select grids.

- 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/animated-corners/
- 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 animated-corners
```

It installs to `components/galactrex/animated-corners.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 { AnimatedCorners } from "@/components/galactrex/animated-corners";

<AnimatedCorners selected={i === picked}><Tile /></AnimatedCorners>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | — | Framed content. |
| `corner` | `number` | `14` | Bracket length at rest. |
| `width` | `number` | `1.5` | Stroke width. |
| `close` | `boolean` | `true` | Close on hover or focus. |
| `selected` | `boolean` | `false` | Keep it closed. |
| `color` | `string` | — | Any CSS colour; defaults to a theme token. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Level select.** A grid where the chosen tile stays framed.

## Accessibility

- Focus within closes it like hover.

## Motion

- Spring length on eight bars.
- Reduced motion: instant.
