A collection of basic UI components built on Tailwind CSS.
Demo.
If you're already using Tailwind and you find yourself repeatedly creating a few common component classes for every project, Sail UI is for you.
This package helps you with a few basic components, so that you can start building your prototype / draft / MVP before you get down to polishing your fully custom design.
Use .btn
, .card
and other classes you're familiar with to get you started and customize them later when you need to.
If you're moving away from another framework to Tailwind and you're afraid of taking the leap because you don't want to build all of those lovely components from scratch yourself, Sail UI will help you with the transition.
npm install sailui
Add sailui
to your tailwind.config.js
file:
module.exports = {
// ...
plugins: [
require('sailui'),
]
}
Start using Sail UI component classes just like how you're used to.
<a href="/" class="btn"></a>
These components are included:
<button class="btn">Sign Up</button>
<button class="btn btn-outline">Find Out More</button>
<div class="card">
Lorem ipsum dolor sit amet...
</div>
<div class="alert">
<strong>Normal stuff!</strong> zero concerns.
</div>
<div class="alert alert-blue">
<strong>All is clear!</strong> So far so good.
</div>
<div class="alert alert-green">
<strong>Fantastic!</strong> You did it.
</div>
<div class="alert alert-yellow">
<strong>Watch out!</strong> Things are going down south.
</div>
<div class="alert alert-red">
<strong>Too late!</strong> It's hit the fan.
</div>
<span class="badge">Default</span>
<span class="badge badge-light">Light</span>
<span class="badge badge-blue">Blue</span>
<span class="badge badge-green">Green</span>
<span class="badge badge-yellow">Yellow</span>
<span class="badge badge-red">Red</span>
Sail UI uses the custom-forms
plugin from Tailwind Labs
to style form elements.
You should refer to the original documentation of custom-forms
for complete details, but to summarize, these elements are available:
<label class="block">
<span class="text-gray-700">Name</span>
<input class="form-input mt-1 block w-full">
</label>
<label class="block">
<span class="text-gray-700">Pet of Choice</span>
<select class="form-select mt-1 block w-full">
<option>Cat</option>
<option>Catty</option>
<option>Kitty</option>
<option>Kat</option>
</select>
</label>
<div class="mt-4">
<span class="text-gray-700">Age Group</span>
<div class="mt-2">
<label class="inline-flex items-center">
<input type="radio" class="form-radio" name="age-group" value="cat">
<span class="ml-2">Cat</span>
</label>
<label class="inline-flex items-center ml-6">
<input type="radio" class="form-radio" name="age-group" value="kitty">
<span class="ml-2">Kitty</span>
</label>
</div>
</div>
<div class="flex mt-6">
<label class="flex items-center">
<input type="checkbox" class="form-checkbox">
<span class="ml-2">I agree to your <span class="underline">terms</span></span>.
</label>
</div>
<label class="block mt-6">
<span class="text-gray-700">Notes</span>
<textarea class="form-textarea mt-1 block w-full" rows="3" placeholder="Write something..."></textarea>
</label>
Sensible default styles are applied to headings, paragraphs, and other elements of typography. These are the covered elements:
- h1
- h2
- h3
- h4
- h5
- h6
- p
The mx-auto
style is automatically applied to center the default .container
that comes out of the box with Tailwind.
The MIT License (MIT). Please see License File for more information.