# Integrate `CornerLetters` from Motion Garden

You are helping me add the **CornerLetters** component to an existing project.
Everything you need is below — full source, dependencies, props and the
behavioural contract. Read it all before writing anything.

- **Component:** CornerLetters
- **Category:** Micro-interactions
- **Summary:** Four glyphs pinned to the container corners that blur-and-scale in on mount and dissolve out on exit.
- **Reference:** https://motion-garden.netlify.app/components/corner-letters
- **Full catalog (for you, the agent):** https://motion-garden.netlify.app/llms.txt

## Stack this source assumes

- React 19 with the Next.js App Router (never the `pages/` directory)
- TypeScript, strict
- Tailwind CSS v4, CSS-first config (utilities are inline; no `tailwind.config` needed)

If my project differs, adapt the integration — but do not rewrite the animation math to suit a different stack. Ask me first.

## Dependencies

```bash
bun add motion
```

## Files to create

One file. Paths are as shipped; the component may live anywhere in my project, but keep every peer file at the exact path shown so the import aliases resolve.

### 1. `components/registry/corner-letters/corner-letters.tsx`

```tsx
"use client";

import { AnimatePresence, motion } from "motion/react";

export interface CornerLettersProps {
	letters: string;
	visible?: boolean;
	stiffness?: number;
	blur?: number;
	scaleFrom?: number;
	offset?: number;
	size?: number;
	color?: string;
	reducedMotion?: boolean;
}

const CORNERS = [
	{ id: "tl", style: { top: 0, left: 0 } },
	{ id: "tr", style: { top: 0, right: 0 } },
	{ id: "bl", style: { bottom: 0, left: 0 } },
	{ id: "br", style: { bottom: 0, right: 0 } },
] as const;

export default function CornerLetters({
	letters,
	visible = true,
	stiffness = 120,
	blur = 8,
	scaleFrom = 1.5,
	offset = 4,
	size = 32,
	color = "#a855f7",
	reducedMotion = false,
}: CornerLettersProps) {
	const glyphs = Array.from(letters).slice(0, 4);

	const hidden = reducedMotion
		? { opacity: 0 }
		: { opacity: 0, filter: `blur(${blur}px)`, scale: scaleFrom };
	const shown = reducedMotion
		? { opacity: 1 }
		: { opacity: 1, filter: "blur(0px)", scale: 1 };

	return (
		<div className="pointer-events-none absolute inset-0 select-none">
			<AnimatePresence>
				{visible &&
					glyphs.map((glyph, i) => (
						<motion.span
							key={CORNERS[i].id}
							initial={hidden}
							animate={{
								...shown,
								transition: reducedMotion
									? { duration: 0 }
									: {
											type: "spring",
											stiffness,
											delay: 0.1 + i * 0.06,
										},
							}}
							exit={{
								...hidden,
								transition: reducedMotion
									? { duration: 0 }
									: { duration: 0.35, delay: i * 0.04 },
							}}
							className="absolute font-light leading-none"
							style={{
								...CORNERS[i].style,
								margin: offset,
								fontSize: size,
								color,
							}}
						>
							{glyph}
						</motion.span>
					))}
			</AnimatePresence>
		</div>
	);
}
```


## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `visible` | `boolean` | `true` | Mounts and unmounts the glyphs — toggle to replay. |
| `stiffness` | `number` | `120` | Spring stiffness of the entrance. Range 40–400. |
| `blur` | `number` | `8` | Blur the glyphs travel from and to. Range 0–20 px. |
| `scaleFrom` | `number` | `1.5` | Starting scale of each glyph. Range 1–3. |
| `offset` | `number` | `4` | Inset from the corners. Range 0–32 px. |
| `size` | `number` | `32` | Glyph font size. Range 16–64 px. |
| `color` | `string (hex)` | `"#a855f7"` | Glyph color. |

## Usage

```tsx
import CornerLetters from "@/components/registry/corner-letters/corner-letters";

<CornerLetters
  visible={true}
  stiffness={120}
  blur={8}
  scaleFrom={1.5}
  offset={4}
  size={32}
  color="#a855f7"
/>
```

The import path matches the file path above; change it if you move the component. Every value shown is the documented default — pass only what you actually want to change. The snippet lists the tunable props only: if the component's props type in the source requires others (content, handlers, data), pass those too.

## Integration rules

- Keep the `"use client"` directive. This is a client component and will not render as a Server Component.
- It fills its parent. Give the wrapper an explicit height (or a definite grid area) — against a height-auto parent it collapses to nothing.
- It takes a `reducedMotion` prop and quiesces when true. Wire it to a `prefers-reduced-motion` listener rather than hardcoding `false`.

## Your task

1. Tell me where in my project this should live and why.
2. Create the files above verbatim.
3. Wire the component into the place I point you at, with sensible props for that context.
4. Flag anything in my setup that conflicts with the stack assumptions above.

Do not restyle the component or alter the animation math unless I ask.
