# Folder Frame

> A folder with a tab on its top edge and a sloping shoulder down to the body.

- Category: Shapes (Outlines that are not rectangles, with borders that follow them.)
- Registry item: `folder-frame`
- Live preview with controls: https://fancyborders.vercel.app/docs/components/folder-frame

## Installation

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

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

The CLI also adds what `folder-frame` is built on: `frame`, `shape-frame`.

Files it adds: `components/ui/frame.tsx`, `components/ui/shape-frame.tsx`, `components/folder-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 { FolderFrame } from "@/components/folder-frame";

<FolderFrame
  tab="invoices"
  fill="var(--background)"
  className="drop-shadow-md"
>
  <div className="p-5">Your content</div>
</FolderFrame>
```

## Good to know

- The tab's content goes in the tab prop. The children start below the tab, so pad them rather than the frame.
- The outline is a plain polygon, so the border, fill and drop-shadow follow it in every browser.

## API reference

### FolderFrame

```tsx
import { FolderFrame } from "@/components/folder-frame";
```

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `tab` | `ReactNode` | – | Content of the tab, such as a label. |
| `tabSide` | `"left" \| "right"` | `"left"` | Which end of the top edge the tab sits on. |
| `tabWidth` | `number` | `112` | Width of the tab's top edge, in pixels. |
| `tabHeight` | `number` | `28` | Height of the tab, in pixels. |
| `slope` | `number` | `14` | How far the tab's shoulder runs sideways on its way down, in pixels. |
| `radius` | `number` | `10` | Radius of the corners, in pixels. |

Also accepts line, fill, color and every div attribute.
