Beautiful animated React button component with smooth hover slide effects. Built with Tailwind CSS and class-variance-authority.
npm install buttonix- React 18+ or 19+
- Tailwind CSS v3+
Add buttonix to your Tailwind config:
// tailwind.config.js
export default {
content: [
"./src/**/*.{js,ts,jsx,tsx}",
"./node_modules/buttonix/dist/**/*.{js,jsx}", // Add this line
],
// ... rest of config
}import { Button } from 'buttonix';
function App() {
return (
<div>
<Button>Go Back</Button>
<Button direction="right" color="bg-blue-500">Next</Button>
<Button variant="destructive">Delete</Button>
</div>
);
}| Prop | Type | Default | Description |
|---|---|---|---|
variant |
'default' | 'destructive' | 'outline' |
'default' |
Button style variant |
direction |
'left' | 'right' |
'left' |
Slide animation direction |
color |
string |
— | Custom Tailwind background class (e.g., 'bg-blue-600') |
className |
string |
— | Additional CSS classes |
<Button>Click Me</Button><Button color="bg-purple-600">Custom Color</Button><Button direction="right">Next →</Button><Button variant="default">Save</Button>
<Button variant="destructive">Delete</Button>
<Button variant="outline">Cancel</Button>MIT © Mahedul Islam Rohan