Get Started
Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- React Hook Form
- Hover Card
- Input
- Input OTP
- Label
- Menubar
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll-area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
- Typography
Installation
Note: This guide is for Remix. For React Router, see the React Router guide.
Create project
Start by creating a new Remix project using create-remix
:
pnpm dlx create-remix@latest my-app
Run the CLI
Run the shadcn
init command to setup your project:
pnpm dlx shadcn@latest init
Configure components.json
You will be asked a few questions to configure components.json
:
Which color would you like to use as base color? › Neutral
App structure
Note: This app structure is only a suggestion. You can place the files wherever you want.
- Place the UI components in the
app/components/ui
folder. - Your own components can be placed in the
app/components
folder. - The
app/lib
folder contains all the utility functions. We have autils.ts
where we define thecn
helper. - The
app/tailwind.css
file contains the global CSS.
Install Tailwind CSS
pnpm add -D tailwindcss@latest autoprefixer@latest
Then we create a postcss.config.js
file:
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
And finally we add the following to our remix.config.js
file:
/** @type {import('@remix-run/dev').AppConfig} */
export default {
...
tailwind: true,
postcss: true,
...
};
Add tailwind.css
to your app
In your app/root.tsx
file, import the tailwind.css
file:
import styles from "./tailwind.css?url"
export const links: LinksFunction = () => [
{ rel: "stylesheet", href: styles },
...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
]
That's it
You can now start adding components to your project.
pnpm dlx shadcn@latest add button
The command above will add the Button
component to your project. You can then import it like this:
import { Button } from "~/components/ui/button"
export default function Home() {
return (
<div>
<Button>Click me</Button>
</div>
)
}
Deploy your shadcn/ui app on Vercel
Trusted by OpenAI, Sonos, Chick-fil-A, and more.
Vercel provides tools and infrastructure to deploy apps and features at scale.
Deploy to Vercel