react-hybrid-form
Version:
A super simple, straightforward and powerful hybrid form library which combines the benefits of both controlled or uncontrolled form.
22 lines (21 loc) • 709 B
TypeScript
import React from "react";
type InputFieldProps = {
type?: "tel" | "url" | "date" | "file" | "text" | "time" | "week" | "color" | "email" | "month" | "range" | "number" | "datetime-local";
name: string;
label?: string;
fieldClass?: string;
inputClass?: string;
labelClass?: string;
errorClass?: string;
placeholder?: string;
defaultValue?: string;
autoComplete?: string;
validate?: (value: string) => string | null;
};
type InputFieldRef = {
validate: () => boolean;
getValue: () => string;
reset: () => void;
};
declare const InputField: React.ForwardRefExoticComponent<InputFieldProps & React.RefAttributes<InputFieldRef>>;
export default InputField;