diff --git a/README.md b/README.md index 01006af..216f018 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,13 @@ Many modern applications need to be internationalized, and this can be an issue In modern JavaScript development bundle size is always a concern - currently form-and-function weights in at just 3.54KB gzipped (14.87KB uncompressed). +## Contents + * [Examples](#examples) * [Installation](#installation) * [Usage](#usage) + * [Form](#form) + * [Field](#field) * [Validation](#validation) * [Built-In Validators](#built-in-validators) * [Custom Errors](#custom-validation-errors) @@ -152,11 +156,65 @@ export const YourApp = () => ( ); ``` +### Form + +The `Form` component will accept the following props: + +* name (string, required) - The name of the form. +* render (component/function, required) - Function/functional component that will render the form - passed InjectedFormProps as below +* renderProps (object, optional) - Custom props to pass to the render component +* validators (object, optional) - Form validation object - see validation +* initialValues (object, optional) - Initial form values in the form `{ [fieldName]: value }` +* onSubmit (function, optional) - Called on form submission with form values +* onSubmitFailed (function, optional) - Called when submission fails due to validation errors, with form values +* onChange (function, optional) - Called when any form value changes, with all form values + +The render component you provide will receive the following props: + +* Field (Component) - A component to create fields +* form (object) - Props that must be passed to a