Tailwind Component Library
80+ accessible Tailwind CSS components: forms, tables, modals, navigation, cards, and data visualization.
Product Preview
Try the interactive reader and demo tools below, or get the full product with all content unlocked.
Interactive Reader (Free Preview) ⚙ Try Demo Tools Download Free SampleFile Structure 22 files
Documentation Preview README excerpt
Tailwind Component Library
A collection of 80+ accessible, copy-paste-ready React components built with Tailwind CSS. Every component follows WAI-ARIA guidelines, includes keyboard navigation, and works across all modern browsers.
What's Included
| Category | Components | Description |
|---|---|---|
| Forms | 12 components | Inputs, selects, checkboxes, radio groups, file uploads, search, date picker |
| Tables | 10 components | Data tables, sortable headers, pagination, filters, expandable rows |
| Modals | 10 components | Dialogs, confirmations, command palette, slide-overs, lightbox |
| Navigation | 11 components | Navbar, sidebar, breadcrumbs, tabs, pagination, steps, mobile menu |
| Cards | 11 components | Content cards, pricing cards, stats, testimonials, product cards |
| Data Viz | 10 components | Bar charts, progress rings, sparklines, KPI tiles, heatmaps |
| Feedback | 11 components | Alerts, toasts, progress bars, skeletons, empty states, error pages |
| Layout | 10 components | Containers, grids, stacks, dividers, sticky headers, scroll areas |
Quick Start
1. Copy the component you need
Each component is self-contained. Open the category file, find the component, and copy it into your project.
2. Ensure Tailwind CSS is configured
These components require Tailwind CSS v3.4+. If you haven't set it up:
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
3. Use the included `tailwind.config.js`
Our config extends the default theme with design tokens used across components:
cp tailwind.config.js your-project/tailwind.config.js
Or merge the relevant extend sections into your existing config.
4. Import and use
import { TextInput, SelectInput, FormGroup } from "./components/forms";
function SignupForm() {
return (
<form>
<FormGroup label="Email" required>
<TextInput type="email" placeholder="[email protected]" />
</FormGroup>
<FormGroup label="Plan">
<SelectInput
options={[
{ value: "free", label: "Free" },
{ value: "pro", label: "Pro — $29/mo" },
]}
/>
*... continues with setup instructions, usage examples, and more.*
Content Sample guides/accessibility.md
Accessibility Guide
This guide explains the accessibility patterns used across every component in the library. Follow these patterns when customizing components to maintain WCAG 2.1 AA compliance.
Core Principles
1. Semantic HTML First
Every component uses the correct HTML element for its purpose. This provides baseline accessibility that works even without JavaScript:
| Purpose | Element | Why |
|---|---|---|
| Navigation | <nav> | Screen readers announce "navigation" landmark |
| Main content | <main> | Allows "skip to content" functionality |
| Footer | <footer> | Identified as "contentinfo" landmark |
| Clickable action | <button> | Keyboard-focusable, announces as "button" |
| Navigation link | <a> | Announces destination, right-click works |
| Form field label | <label> | Clicking the label focuses the input |
| Modal | <div role="dialog"> | Announces as "dialog" to screen readers |
| Tab interface | role="tablist" / role="tab" | Proper tab semantics |
Anti-pattern to avoid: Using <div onClick> instead of <button>. A div has no keyboard support, no screen reader announcement, and no built-in focus styling.
2. Keyboard Navigation
Every interactive component works with the keyboard:
| Component | Tab | Enter/Space | Escape | Arrow Keys |
|---|---|---|---|---|
| Buttons | Focus | Activate | - | - |
| Text inputs | Focus | Submit form | - | Move cursor |
| Checkboxes | Focus | Toggle | - | - |
| Radio groups | Focus group | Select | - | Next/previous option |
| Toggle switch | Focus | Toggle | - | - |
| Tabs | Focus tab list | Select tab | - | Next/previous tab |
| Modals | Focus first element | Activate focused element | Close modal | - |
| Dropdowns | Focus trigger | Open/close | Close | Navigate items |
| Command palette | Focus search | Select item | Close | Navigate items |
3. Focus Management
Visible Focus Indicators:
All focusable elements have a visible focus ring using Tailwind's focus-visible:ring-2:
// We use focus-visible instead of focus so the ring only appears
// during keyboard navigation, not mouse clicks
*... and much more in the full download.*