# Installation

> Components are copied into your project, one command each. There is no package to install or keep up to date.

## Requirements

- React 18 or later.
- Tailwind CSS v4.
- A `components.json` file, which the shadcn CLI reads to know where your components and stylesheet live. Create one with `npx shadcn@latest init`.

## Install with the CLI

Every component page has its own command. This one adds the bracket frame:

```bash
npx shadcn@latest add https://fancyborders.vercel.app/r/bracket-frame.json
```

The CLI copies the component into your components folder (for example `components/bracket-frame.tsx`), adds anything it is built on (here the `frame` primitive in `components/ui/frame.tsx`), and writes the component's CSS into your global stylesheet.

Other package managers: `pnpm dlx shadcn@latest add …`, `yarn dlx shadcn@latest add …`, `bunx --bun shadcn@latest add …`.

## The registry namespace

Add the registry to `components.json` once, then install by name:

```bash
npx shadcn@latest registry add @fancyborders=https://fancyborders.vercel.app/r/{name}.json
npx shadcn@latest add @fancyborders/bracket-frame
```

That writes this to `components.json`:

```json
{
  "registries": {
    "@fancyborders": "https://fancyborders.vercel.app/r/{name}.json"
  }
}
```

The registry index is at https://fancyborders.vercel.app/r/registry.json.

## Use it

```tsx
import { BracketFrame } from "@/components/bracket-frame";

export function Feature() {
  return (
    <BracketFrame className="p-5">
      <h3>Corner brackets</h3>
      <p>Around anything you put inside.</p>
    </BracketFrame>
  );
}
```

## Install by hand

Copy every file the item lists, dependencies first, from its registry JSON (https://fancyborders.vercel.app/r/<item>.json) or its page. The CSS belongs in your global stylesheet after the Tailwind import, so its rules land in Tailwind's `components` layer and utilities can still override them:

```css
@import "tailwindcss";

/* Component CSS goes here, after Tailwind. */
@layer components {
  .fb-frame {
    /* … */
  }
}
```

Components import a `cn` helper from `@/lib/utils`, the same one shadcn/ui uses. Without it, install `clsx` and `tailwind-merge` and add:

```ts
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs));
}
```

## Browser support

Structural frames and line styles use only widely supported CSS. Curved shape corners need the CSS `shape()` function and fall back to a rectangular border. The beam needs `offset-path` (Chromium 116, Firefox 122, Safari 18) and leaves the plain border without it. Liquid metal needs WebGL and shows the frame's plain line without it.
