Vue-Tailwind
VueTailwind is a set of Vue components created to be customized to adapt to the unique design of your application.
Built to be customized
When you work on a real-world application, you usually need different variants for every component your app uses; you may need (besides of default style of your text input) a specific style for a search input inside a navbar and another one for the contact form, and we are not talking yet about the different states that your input could have.
All VueTailwind components were designed to be customized with custom CSS classes and unlimited variants defined when you import the library or when you use the component.
This means that when you use this library, you are not attached to any style defined by us like it happens when you use a typical library of components like Bootstrap. Instead, you can determine your theme based on your application's needs.
This library makes special sense when you work with utility-first frameworks like TailwindCss, which is the default framework used in this library.
Installation
1. Install the dependencies
Or:
2. Configure your project to use vue-tailwind
Apply your own theme:
Let's say, for example, that for the specific needs of your project the text inputs should have a blue two width border
, the buttons should have rounded borders
and you need a secondary button that should be purple
.
Considering those needs define objects with the desired classes for every component, a good approach is to create a file where you define the template:
Then you can import your theme and add it as a parameter when you install VueTailwind:
Or just define the settings directly:
Quick start
Here is a small example of how the classes and variants are defined when you import this library:
The default classes and variants can also be defined in the component props:
To apply an specific variant you just need to use the variant
prop:
The variant prop also accepts an object that takes the first attribute with a truthy value
What's new in version 1.x
- Rebuilt from scratch in Typescript
- Small bundle size and less dependencies
- A better way to import only selected components
- Unlimited variants and a easy way to configure them
What's next?
- Im working in a datepicker that is the most requested component, after that im planning to create a swal like dialog component.
- Already started to work in a react version of this package called react-tailwind.
- Im making some final changes to the Community themes features that should be released soon.
- Vue 3 compatibility