Docs
Utilities
The helper, packages and building blocks our blocks use, for when you copy code by hand.
The CLI installs all of this for you. Read on if you copy a block's code by hand, or want to know what a block depends on.
The cn() helper
Every block merges class names with cn() from @/lib/utils. npx shadcn@latest init creates it. Without shadcn, install the two packages and add the file yourself:
pnpm add clsx tailwind-mergeimport { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}Icons and motion
Icons come from lucide-react. Blocks that animate use motion and import it from motion/react.
pnpm add lucide-react motionshadcn/ui components
Blocks use stock shadcn/ui parts such as Button, Input, Card, Badge and Avatar from @/components/ui. Add the ones a block imports:
pnpm dlx shadcn@latest add button input card badge avatarOur building blocks
Where shadcn/ui has nothing, such as the logo marquee, the number ticker or the device frames, we publish our own piece once and blocks import it from @/components/ui/<name>. Add one by name:
pnpm dlx shadcn@latest add @twe/marquee