Start by creating a new Gatsby project using create-gatsby:
Configure your Gatsby project to use TypeScript and Tailwind CSS
You will be asked a few questions to configure your project:
Edit tsconfig.json file
Add the following code to the tsconfig.json file to resolve paths:
Create gatsby-node.ts file
Create a gatsby-node.ts file at the root of your project if it doesn’t already exist, and add the code below to the gatsby-node file so your app can resolve paths:
Run the CLI
Run the shadcn-ui init command to setup your project:
Configure components.json
You will be asked a few questions to configure components.json:
That's it
You can now start adding components to your project.
The command above will add the Button component to your project. You can then import it like this: