Installation
How to install and set up Shelf UI components in your project.
Shelf UI components are designed for React projects using Tailwind CSS v4 and TypeScript. Follow the steps below to get set up.
Prerequisites
Make sure your project has the following:
- React 19 or later
- Tailwind CSS v4
- TypeScript
Shelf UI also depends on shared utilities from shadcn/ui. If you don't have shadcn set up yet, initialize it first:
npx shadcn@latest initpnpm dlx shadcn@latest inityarn dlx shadcn@latest initbunx shadcn@latest initAdd registry
Add the Shelf UI registry to your components.json:
{
"registries": {
"@shelf-ui": "https://shelf-ui.vercel.app/r/{name}.json"
}
}Add components
Option 1: shadcn CLI (recommended)
npx shadcn@latest add @shelf-ui/dropzonepnpm dlx shadcn@latest add @shelf-ui/dropzoneyarn dlx shadcn@latest add @shelf-ui/dropzonebunx shadcn@latest add @shelf-ui/dropzoneOption 2: Direct URL
Add components by passing the registry URL directly:
npx shadcn@latest add https://shelf-ui.vercel.app/r/dropzone.jsonpnpm dlx shadcn@latest add https://shelf-ui.vercel.app/r/dropzone.jsonyarn dlx shadcn@latest add https://shelf-ui.vercel.app/r/dropzone.jsonbunx shadcn@latest add https://shelf-ui.vercel.app/r/dropzone.jsonOption 3: Manual installation
Copy the component source directly from its docs page into your project and install the required dependencies listed on that page.
Each component page includes the full source and a list of peer dependencies required. The shadcn CLI handles this automatically in Options 1 and 2.
Project structure
After adding components, your project will look like this:
components/
├── shelf-ui/
│ └── dropzone.tsx # Shelf UI component
├── ui/
│ ├── button.tsx # shadcn/ui primitive
│ └── ...
hooks/
│ └── use-file-upload.ts # Shelf UI hook
└── ...Components in shelf-ui/ are Shelf UI primitives. Components in ui/ are shared shadcn/ui primitives that Shelf UI components may depend on.
Usage
Import and use components directly:
import { Dropzone } from "@/components/shelf-ui/dropzone";
import {
FileCard,
FileCardActions,
FileCardIcon,
FileCardInfo,
} from "@/components/shelf-ui/file-card";
export default function Page() {
return (
<>
{/* Simple component — use props */}
<Dropzone
onDrop={(files) => console.log(files)}
accept={["image/*", ".pdf"]}
maxSize={10 * 1024 * 1024}
/>
{/* Compound component — compose sub-components */}
<FileCard>
<FileCardIcon type="pdf" />
<FileCardInfo name="report.pdf" size="2.4 MB" />
<FileCardActions>
<Button size="icon">
<Download />
</Button>
</FileCardActions>
</FileCard>
</>
);
}See individual component pages for detailed usage, props, and examples.
Last Updated on Jun 25, 2026