tv
An instance of tailwind-variants extended with AlignUI classes.
Installation
Install the following dependencies:
terminal
npm install tailwind-variantsInclude the cn utility by referring to the cn page to set it up before adding tv.
Create a utils/tv.ts file and paste the following code into it.
/utils/tv.ts
IntelliSense setup (optional)
If you are using VSCode and the TailwindCSS IntelliSense Extension, you have to add the following to your .vscode/settings.json file to enable Intellisense features for cn, cnExt and tv functions.
.vscode/settings.json
Prettier setup (optional)
If you're using prettier-plugin-tailwindcss, you can include tv in the functions list to ensure it gets sorted as well.
prettier.config.mjs
Examples
For examples and detailed usage, refer to tailwind-variants documentation.
All you need to do here is use the tv function from @/utils/tv instead of tailwind-variants package.
© 2024 AlignUI Design System. All rights reserved.
