interface InputProps {
label?: string;
placeholder?: string;
className?: string;
htmlType?: string;
autoComplete?: string;
size?: string;
ariaLabel?: string;
required?: boolean;
}
const Input = forwardRef(function Input(
props: InputProps,
ref: React.RefObject<HTMLInputElement>
) {
const {
label,
placeholder,
className,
htmlType,
autoComplete,
size,
ariaLabel,
required,
} = props;
return (
<div className={clsx(styles.root, className)}>
<label>
{label && <div className={styles.label}>{label}</div>}
<input
type={htmlType}
autoComplete={autoComplete}
placeholder={placeholder}
ref={ref}
className={clsx(styles.input, size && styles[size])}
aria-label={ariaLabel}
required={required}
/>
</label>
</div>
);
});
export default Input;
код для инпута