UNPKG

react-proforma

Version:

React Proforma helps you build simple to complex web forms with ease in React. -- Simplicity where you want it. Flexibility where you need it.

24 lines (23 loc) 1.32 kB
import React from 'react'; import { IndexableObjectType } from './types'; interface IFieldProps { name: string; type?: string; component?: React.ComponentType<any>; customOnChange?: (args?: any) => any; customValue?: any; style?: { [key: string]: string; }; } /** * Component to produce an input form element, either with * a standard input tag, or with your own custom component. * * @param {string} name - name of the form element, which MUST be the same string value as the corresponding value in your "initialValues" object. * @param {string=} [type] - input type of the form element (i.e. "text", "password", "email", "date", etc.). Defaults to 'text'. NOTES: 1) For checkboxes and radio button inputs, use the Checkbox and Radio components. 2) input type="file" is read-only, so cannot be a controlled component. * @param {React.ComponentType=} [component] - Optional custom component to be used instead of a standard textarea tag. * @returns {JSX.Element} JSX.Element */ export declare const Field: React.ForwardRefExoticComponent<Pick<IFieldProps & IndexableObjectType<any> & React.ClassAttributes<HTMLInputElement> & React.InputHTMLAttributes<HTMLInputElement>, string | number> & React.RefAttributes<HTMLElement & HTMLInputElement>>; export {};