Components / Structure

Section Rule

A line between page sections that runs past the page rails, with a mark on each intersection.

Section one

Section two

Customize

Mark
Bleed
32px
Dashed
Line
1px

Installation

npx shadcn@latest add https://fancyborders.vercel.app/r/section-rule.json

The CLI copies the component into your project, adds anything it is built on, and writes its CSS into your global stylesheet. New to the CLI? See Installation.

Examples

Dashes and other marks

A rule takes a dash pattern and any corner mark, or none.

Plus marks

Dashed, no marks

Thicker, in colour

To the page edges

Good to know

  • Set bleed to true to run the line a full viewport width each way. The page then needs overflow-x: clip on an ancestor.
  • The rule is as tall as the frame's line, so frame-line-2 thickens it. For a band rather than a line, use the hatch divider.

API reference

SectionRule

tsx
import { SectionRule } from "@/components/section-rule";
PropTypeDefault
bleedboolean | number | string

How far the line runs past each end. true runs it a full viewport width each way.

false
mark"bracket" | "square" | "plus" | "dot" | false

Mark drawn on each end of the line.

"square"
dashnumber | string

Dash length. Setting dash or gap makes the line dashed.

4
gapnumber | string

Space between dashes.

4

Also accepts every Frame prop and every div attribute.