# Ticket Frame

> A ticket with rounded corners, a perforated line and a tear-off stub.

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

## Installation

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

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

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

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

<TicketFrame
  stub={<Stub />}
  fill="var(--background)"
  className="drop-shadow-md"
>
  Your content
</TicketFrame>
```

## Good to know

- Use a drop-shadow filter rather than box-shadow for a shadow that follows the bites in every browser.

## API reference

### TicketFrame

```tsx
import { TicketFrame } from "@/components/ticket-frame";
```

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `stub` | `ReactNode` | – | Content of the tear-off stub on the right. Required. |
| `stubWidth` | `number` | `112` | Width of the stub, in pixels. |
| `punchRadius` | `number` | `9` | Radius of the bites at the top and bottom of the perforation. |
| `radius` | `number` | `12` | Radius of the outer corners. |

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