skip to Main Content

I want to install both tailwind + react with one command. Creating empty template files (copy pasting an empty tailwind installed project) makes my file system weird.

I searched for it and actually find nothing helpful. There is a create-vite-tailwind package but not working for me till it’s pure html & javascript.

3

Answers


  1. There are lots of starter projects on Github (like this one). You can explore more on Github.

    Login or Signup to reply.
  2. First, make sure you have Node.js and npm (Node Package Manager) installed on your system.
    Then, you can create a new React project with Create React App and integrate Tailwind CSS using a single command:

    npx create-react-app my-tailwind-react-app --template cra-template-tailwindcss
    
    Login or Signup to reply.
  3. These commands should get you started with a Vite + TailwindCSS boilerplate

    NPM

    npm init vite@latest my-react-tailwind-project -- --template react
    cd my-react-tailwind-project
    npm install -D tailwindcss@latest postcss@latest autoprefixer@latest
    npx tailwindcss init -p
    

    Yarn

    yarn create vite@latest my-react-tailwind-project -- --template react
    cd my-react-tailwind-project
    yarn add -D tailwindcss@latest postcss@latest autoprefixer@latest
    npx tailwindcss init -p
    

    "my-react-tailwind-project" can be changed to whatever project name you choose.

    You can continue with the rest of your configurations from there.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search