From 2a92d8b2245f1b29ebb765ec67a4ddfa676de0b8 Mon Sep 17 00:00:00 2001 From: Jitendra Nirnejak Date: Mon, 1 Jul 2024 21:35:31 +0530 Subject: [PATCH] Button: component added with variants --- components/atoms/Button.tsx | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 components/atoms/Button.tsx diff --git a/components/atoms/Button.tsx b/components/atoms/Button.tsx new file mode 100644 index 0000000..2345b7a --- /dev/null +++ b/components/atoms/Button.tsx @@ -0,0 +1,45 @@ +import * as React from "react" + +import { cva, type VariantProps } from "class-variance-authority" + +import classNames from "@/utils/classNames" + +const buttonVariants = cva("rounded-md", { + variants: { + variant: { + primary: "bg-blue-500", + secondary: "bg-gray-500", + }, + size: { + sm: "px-2 py-1", + md: "px-3 py-2", + lg: "px-4 py-3", + }, + defaultVariants: { + variant: "primary", + size: "md", + }, + }, +}) + +export interface Props + extends React.ButtonHTMLAttributes, + VariantProps { + asChild?: boolean +} + +const Button: React.FC = ({ children, className, ...props }) => { + return ( + + ) +} + +export default Button