Setup
How to install components.
VSCode
-
Ensure you have your project initialized with your chosen framework as well as TailwindCSS.
-
Follow the steps under the init command in the VScode Extension section.
Manual Installation
-
Dependencies
npm i react-aria-components tailwind-variants tailwindcss-animate lucide-react
-
Tailwind Preset
Create a file in the root of your project called tailwindPreset.js Copy the contents below into the file.
-
tailwind.config
Add the preset to your tailwind config.
*If you are using next.js with the App dir, you will likely need to add
./components/**/*.{ts,tsx}
to your tailwind content array. -
global.css
Optional Configurations
-
Path Alias
The default for all components is @/components/base.
{ "compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["./*"] } } }
-
TW IntelliSense
If you are using VScode and would like to enable auto-complete/highlights (for Tailwind Variants), add the following to your settings.json.
{ "tailwindCSS.experimental.classRegex": [ ["tv\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"] ] }
-
class sorting
If you are using the Tailwind-Prettier sorting plugin, and would like this plugin to sort classes within Tailwind Variants, add the following to your module.exports inside your Prettier.config.
tailwindFunctions: ["tv"],