React Router Installation

Install and configure your UI components for React Router projects.

Create project

pnpm dlx create-react-router@latest my-app

Run the CLI

Run the shadcn init command to setup your project:

pnpm dlx shadcn@latest init

Add Components

You can now start adding components to your project. For example, to add the Button component:

pnpm dlx shadcn@latest add button

The command above will add the Button component to your project. You can then import and use it like this:

1import { Button } from "~/components/ui/button"
2
3export default function Home() {
4 return (
5 <div className="flex min-h-svh flex-col items-center justify-center">
6 <Button>Click me</Button>
7 </div>
8 );
9}

For more details, see the documentation for each component.