# Dash Patterns

> Dashed lines with the dash and the gap set independently, which a CSS border cannot do.

- Category: Lines (Line styles for any frame: dashes, native styles and motion.)
- Registry item: `frame` — Dash Patterns 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/dash-patterns

## 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, FrameRules } from "@/components/ui/frame";

<Frame className="p-6">
  <FrameRules dash={6} gap={4} />
  Content
</Frame>
```

## Good to know

- Rules are four straight lines, so they ignore the radius. For a dashed line that follows rounded corners use FrameBorder with the dashed variant.

## API reference

### FrameRules

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

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `sides` | `("top" \| "right" \| "bottom" \| "left")[]` | `all four` | Which sides get a line. |
| `overshoot` | `number \| string \| { x?, y? }` | `0` | How far the lines run past the corners. x extends the horizontal lines, y the vertical ones. |
| `dash` | `number \| string` | `4` | Dash length. Setting dash or gap makes the lines dashed. |
| `gap` | `number \| string` | `4` | Space between dashes. |
| `march` | `boolean \| number` | `false` | Make the dashes travel clockwise. A number is the seconds a dash takes to reach the next one's place; true is 0.6. |
| `offset` | `number \| string` | `0` | Distance from the frame's edge. Positive is outward, negative inward. |
| `color` | `string` | – | Overrides the frame's line colour for this layer. |

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