Files
users-myfit/src/components/Helpers/Inputs/InputCom/index.jsx
T
Chukwumdiebube ae01f21c61 Styled text input
2023-02-16 14:23:08 +01:00

44 lines
1.2 KiB
React
Executable File

import React from "react";
import Icons from "../../Icons";
export default function InputCom({
label,
type,
name,
placeholder,
iconName,
inputHandler,
value,
maxLength,
borderColor
}) {
return (
<div className="input-com">
{label && (
<label
className="input-label text-dark-gray dark:text-white text-xl font-bold block mb-2.5"
htmlFor={name}
>
{label}
</label>
)}
<div className={`input-wrapper border border-light-purple dark:border-[#5356fb29] w-full rounded-[50px] h-[58px] overflow-hidden relative ${borderColor}`}>
<input
placeholder={placeholder}
value={value}
onChange={inputHandler}
className="input-field placeholder:text-base text-base px-6 text-dark-gray dark:text-white w-full h-full bg-[#FAFAFA] dark:bg-[#11131F] focus:ring-0 focus:outline-none"
type={type}
id={name}
name={name}
maxLength={maxLength}
/>
{iconName && (
<div className="absolute right-6 bottom-[19px] z-10">
<Icons name={iconName} />
</div>
)}
</div>
</div>
);
}