A reusable and customizable React button component with class variance authority and Tailwind CSS integration.
npm install class-variance-authority tailwindcss tailwind-merge
import Button from '/src/components/Button/Button';
<Button style="filled">Click me!</Button>
children: JSX.Element | React.ReactNode - Content of the button.
className: string - Additional class names for styling.
onClick: (event: React.MouseEvent
The Button component supports two basic styles using the style prop:
filled: Filled background with white text.
outlined: Outlined button with blue border and text.
This component includes Storybook stories for easy development and testing. Use the stories to visualize different variants:
Default: Default button. Filled: Button with filled style. Outlined: Button with outlined style.
npm install
npm run storybook
Visit http://localhost:6006 to view and interact with the stories.