# Blueprint

> A pattern fill behind a border, with marks at the corners.

- Category: Frames (Structural frames: brackets, rails, marks and hatching.)
- Registry item: `frame` — Blueprint is a recipe: a few layers of `frame` put together, not an item of its own. Install `frame` and copy the code below.
- Live preview with controls: https://fancyborders.vercel.app/docs/components/blueprint

## Installation

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

With the registry namespace: `npx shadcn@latest add @fancyborders/frame`.

Files it adds: `components/ui/frame.tsx`, and its CSS goes into the global stylesheet after the Tailwind import.

## Usage

The code for the preview at its default settings:

```tsx
import {
  Frame,
  FrameBorder,
  FrameCorners,
  FrameFill,
} from "@/components/ui/frame";

<Frame className="p-6">
  <FrameFill pattern="grid" size={16} />
  <FrameBorder />
  <FrameCorners mark="square" />
  Content
</Frame>
```

## API reference

### FrameFill

```tsx
import { FrameFill } from "@/components/ui/frame";
```

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `pattern` | `"hatch" \| "cross" \| "dots" \| "grid"` | `"hatch"` | The pattern painted behind the content. |
| `size` | `number \| string` | `6` | Spacing between lines or dots. |
| `thickness` | `number \| string` | `1` | Line width, or dot radius. |
| `angle` | `string` | `"135deg"` | Direction of the hatch lines. |
| `inset` | `number \| string` | `0` | Distance kept clear from the frame's edge. |
| `color` | `string` | – | Colour of the pattern. Defaults to the line colour. |

Also accepts every div attribute, such as className and style.

### FrameBorder

```tsx
import { FrameBorder } from "@/components/ui/frame";
```

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"solid" \| "dashed" \| "dotted" \| "double"` | `"solid"` | The CSS border style. |
| `offset` | `number \| string` | `0` | Distance from the frame's edge. Positive is outward, negative inward. |
| `radius` | `number \| string` | – | Overrides the frame's radius for this layer. |
| `color` | `string` | – | Overrides the frame's line colour for this layer. |

Also accepts every div attribute, such as className and style.

### FrameCorners

```tsx
import { FrameCorners } from "@/components/ui/frame";
```

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `mark` | `"bracket" \| "square" \| "plus" \| "dot"` | `"bracket"` | Built-in mark. Ignored when children are given. |
| `children` | `ReactNode` | – | A custom mark, drawn for the top-left corner and repeated on the rest. |
| `corners` | `("tl" \| "tr" \| "br" \| "bl")[]` | `all four` | Which corners get a mark. |
| `size` | `number \| string` | `12, 7, 11 or 5` | Width and height of each mark. The default depends on the mark: bracket, square, plus, dot. |
| `thickness` | `number \| string` | – | Line width of the mark, when different from the frame's. |
| `align` | `"inside" \| "center"` | – | inside tucks the mark into the corner, center centres it on the frame's line. Brackets and custom marks default to inside. |
| `rotate` | `boolean` | `true` | Rotate each mark to face its corner. Turn off for upright content. |
| `offset` | `number \| string` | `0` | Distance from the frame's edge. Positive is outward, negative inward. |
| `radius` | `number \| string` | – | Radius of a bracket's corner, when different from the frame's. |
| `color` | `string` | – | Colour of the marks. Defaults to the text colour. |

Also accepts every div attribute, such as className and style.
