Skip to main content
Note: This guide is for Remix. For React Router, see the React Router guide.
1
Create project
2
Start by creating a new Remix project using create-remix:
3
npx create-remix@latest my-app
4
Run the CLI
5
Run the shadcn init command to setup your project:
6
npx shadcn@latest init
7
Configure components.json
8
You will be asked a few questions to configure components.json:
9
Which color would you like to use as base color? Neutral
10
App structure
11
Note: This app structure is only a suggestion. You can place the files wherever you want.
12
  • 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 a utils.ts where we define the cn helper.
  • The app/tailwind.css file contains the global CSS.
  • 13
    Install Tailwind CSS
    14
    npm install -D tailwindcss@latest autoprefixer@latest
    
    15
    Then we create a postcss.config.js file:
    16
    export default {
      plugins: {
        tailwindcss: {},
        autoprefixer: {},
      },
    }
    
    17
    And finally we add the following to our remix.config.js file:
    18
    /** @type {import('@remix-run/dev').AppConfig} */
    export default {
      ...
      tailwind: true,
      postcss: true,
      ...
    };
    
    19
    Add tailwind.css to your app
    20
    In your app/root.tsx file, import the tailwind.css file:
    21
    import styles from "./tailwind.css?url"
    
    export const links: LinksFunction = () => [
      { rel: "stylesheet", href: styles },
      ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
    ]
    
    22
    That’s it
    23
    You can now start adding components to your project.
    24
    npx shadcn@latest add button
    
    25
    The command above will add the Button component to your project. You can then import it like this:
    26
    import { Button } from "~/components/ui/button"
    
    export default function Home() {
      return (
        <div>
          <Button>Click me</Button>
        </div>
      )
    }
    

    Build docs developers (and LLMs) love