Installation
Components are copied into your project, one command each. There is no package to install or keep up to date.
Requirements
- React 18 or later.
- Tailwind CSS v4.
- A
components.jsonfile, which the shadcn CLI reads to know where your components and stylesheet live.
If the project has no components.json yet, create one first:
npx shadcn@latest initInstall with the CLI
Every component page has its own command. This one adds the bracket frame:
npx shadcn@latest add https://fancyborders.vercel.app/r/bracket-frame.jsonThe CLI does three things:
- copies the component into your components folder, for example
components/bracket-frame.tsx; - adds anything it is built on, here the
frameprimitive incomponents/ui/frame.tsx; - writes the component's CSS into your global stylesheet.
Use it
Import the component from your own project and wrap your content:
import { BracketFrame } from "@/components/bracket-frame";
export function Feature() {
return (
<BracketFrame className="p-5">
<h3>Corner brackets</h3>
<p>Around anything you put inside.</p>
</BracketFrame>
);
}Each page in the component list has a live preview with controls. Set it up the way you want, then copy the code it writes.
Install by hand
Without the CLI, open a component's page and choose Manual under Installation. It lists every file to copy, dependencies first, and the CSS to add.
The CSS belongs in your global stylesheet after the Tailwind import, so its rules land in Tailwind's components layer and utilities can still override them:
@import "tailwindcss";
/* Component CSS goes here, after Tailwind. */
@layer components {
.fb-frame {
/* … */
}
}Components import a cn helper from @/lib/utils, the same one shadcn/ui uses. If you do not have it, install clsx and tailwind-merge and add it:
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}Browser support
Structural frames and line styles use only widely supported CSS and work wherever Tailwind CSS v4 does. A few components reach for newer features and fall back when they are missing:
- Curved shape corners need the CSS
shape()function, and fall back to a rectangular border. - The beam needs
offset-path(Chromium 116, Firefox 122, Safari 18), and leaves the plain border without it. - Liquid metal needs WebGL, and shows the frame's plain line without it.