Add generic button component
This commit is contained in:
parent
ca6fd65f96
commit
1293d40894
2 changed files with 19 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import Button from "@/components/ui/Button";
|
||||
import Form from "@/components/ui/Form";
|
||||
import Hyperlink from "@/components/ui/Hyperlink";
|
||||
import Referencelink from "@/components/ui/Referencelink";
|
||||
|
|
@ -6,6 +7,9 @@ import RoundedContainer from "@/components/ui/RoundedContainer";
|
|||
export default function Components() {
|
||||
return (
|
||||
<div className="flex flex-col items-center gap-4 w-full h-full">
|
||||
<h1>Button</h1>
|
||||
<Button title={"Button"} mode="DARK" />
|
||||
|
||||
<h1>Form</h1>
|
||||
<Form action={"Action here"} submitText="Example submit button ">
|
||||
<input type="text" name="text" placeholder="example placeholder text" />
|
||||
|
|
|
|||
15
components/ui/Button.tsx
Normal file
15
components/ui/Button.tsx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
export default function Button({
|
||||
title,
|
||||
mode = "LIGHT",
|
||||
}: {
|
||||
title: string;
|
||||
mode?: "DARK" | "LIGHT";
|
||||
}) {
|
||||
return (
|
||||
<button
|
||||
className={`${mode == "LIGHT" ? "bg-slate-400 dark:bg-slate-800 hover:bg-slate-600" : "bg-gray-400 dark:bg-slate-900"} font-medium py-2 px-4 rounded-lg shadow-md transition duration-200 ease-in-out`}
|
||||
>
|
||||
{title}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue