mirror of
https://github.com/dyzulk/trustlab.git
synced 2026-01-26 21:41:52 +07:00
28 lines
614 B
TypeScript
28 lines
614 B
TypeScript
import React, { FC, ReactNode } from "react";
|
|
import { twMerge } from "tailwind-merge";
|
|
|
|
interface LabelProps {
|
|
htmlFor?: string;
|
|
children: ReactNode;
|
|
className?: string;
|
|
}
|
|
|
|
const Label: FC<LabelProps> = ({ htmlFor, children, className }) => {
|
|
return (
|
|
<label
|
|
htmlFor={htmlFor}
|
|
className={twMerge(
|
|
// Default classes that apply by default
|
|
"mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400",
|
|
|
|
// User-defined className that can override the default margin
|
|
className
|
|
)}
|
|
>
|
|
{children}
|
|
</label>
|
|
);
|
|
};
|
|
|
|
export default Label;
|