Production-ready Material Design 3 components for Tailwind CSS.
- 🎨 Material 3 Design System: Complete implementation of Google's Material 3 design spec.
- 🔧 Tailwind CSS Plugin: Seamless integration as a standard Tailwind plugin.
- 🌙 Dark Mode: Built-in support for light and dark themes.
- 🎭 Dynamic Colors: Works with
tailwind-material-colorsfor dynamic theming. - 🧩 15+ Components: Buttons, Cards, Inputs, Dialogs, Navigation, and more.
- ♿ Accessible: Designed with ARIA attributes and keyboard navigation in mind.
- 📐 TypeScript: Fully typed for excellent developer experience.
| Category | Components |
|---|---|
| Actions | Button, FAB, Icon Button |
| Communication | Badge, Snackbar, Tooltip |
| Containment | Card, Dialog, Bottom Sheet |
| Navigation | Navigation Drawer, App Bar (Top/Bottom), Tabs |
| Selection | Checkbox, Radio, Switch, Chip, Menu |
| Inputs | Text Field |
| Utils | List, Progress Indicator, Divider |
Install the package and its peer dependencies:
npm install tailwind-material-3 tailwind-material-colorsNote for Tailwind CSS v4: This library uses a JavaScript configuration wrapper to inject Material 3 design tokens and plugins. Even if you are using Tailwind v4, you must use a tailwind.config.js (or .ts) file for this library to work correctly.
Add the plugin to your tailwind.config.js (or tailwind.config.ts) file:
import { createMaterialConfig } from 'tailwind-material-3';
export default createMaterialConfig({
content: ['./src/**/*.{html,js,ts,jsx,tsx}'], // Adapt to your framework
theme: {
extend: {
// Your custom theme extensions
},
},
// You can still add other plugins here
plugins: [],
});
// Or if you prefer the standard plugin approach (recommended for Tailwind v4 compatibility):
import { tailwindMaterial3 } from 'tailwind-material-3';
export default {
content: ['./src/**/*.{html,js,ts,jsx,tsx}'],
plugins: [
tailwindMaterial3
]
};Start using the components in your HTML/JSX:
<!-- Filled Button -->
<button class="md-btn md-btn-filled">
Click Me
</button>
<!-- Outlined Card -->
<div class="md-card md-card-outlined p-4">
<h3 class="text-md-title-medium">Card Title</h3>
<p class="text-md-body-medium">Card content goes here.</p>
</div>
<!-- Text Field -->
<div class="md-text-field md-text-field-outlined">
<input type="text" class="md-text-field-input" placeholder=" " />
<label class="md-text-field-label">Username</label>
</div>Tailwind Material 3 is designed to work with tailwind-material-colors to generate your color palette. You can define your primary source color in your Tailwind config.
By default, the library provides a standard M3 purple-based theme. To customize it, simply override the colors in your Tailwind config or use the tailwind-material-colors plugin alongside this one.
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
<button class="md-btn md-btn-filled">
Action
</button>
`
})
export class AppComponent {}export default function App() {
return (
<button className="md-btn md-btn-filled">
Action
</button>
);
}Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.