A pack of extensions for grommet 2
created:7/7/2021
updated:7/7/2021
loc
229
comments
4%
passed
4
failed
6
coverage
10%

Form

avatar of atanasster
avatar of Atanas Stoyanov
avatar of GitHub
avatar of Bart Visscher
grommet-controls
3.0.2

A Form with built-in validation.

import { Form } from 'grommet-controls';

On Change

Name
Description
Default
IFormProps(10 properties)
a11yTitle

Custom title to be used by screen readers

string
-
focusFirstChild

Whether to focus the first form control on mounting

boolean
true
object

Initial values of the form data object

object
{}
onSubmit

A function called when the user successfully submits the form

(data: object) => void
undefined
onChange

A function invoked when any of the values in the form are changing

(name: string, value: any, event: MouseEvent<HTMLElement, MouseEvent> & { value: any; }) => void
undefined
onSubmitError

A function invoked when an error occured during submitting

(errors: IFormErrors) => void
undefined
onValidForm

A function invoked on every change when the form is valid

(data: object) => void
undefined
onInvalidForm

A function invoked on every change when the form is invalid

(data: object) => void
undefined
tag

The DOM tag to use for the form

string & PolymorphicType
form
className

css class name, assigned by styled-components

string
-
BoxProps(26 properties)

Commits

Date
Author
Commit Message
8/31/2020

atanasster

avatar of atanasster
update stories titles and navigation
8/30/2020

atanasster

avatar of atanasster
update versions for publish
8/30/2020

atanasster

avatar of atanasster
update eslint and add component-controls
8/30/2020

Atanas Stoyanov

avatar of Atanas Stoyanov
Merge pull request #33 from bartv2/form-initial-values
8/30/2020

Bart Visscher

avatar of Bart Visscher
Adding initialValues prop because the object prop makes this a controlled component
8/30/2020

Bart Visscher

avatar of Bart Visscher
Fix missing filterByFocusable in grommet
8/27/2019

atanasster

avatar of atanasster
initial commit 2.x alpha
7 commits
package
imports
peer
grommet
^2.15.0
BoxPropsBox
*
deepMerge
*
react
^17.0.1
ReactComponent
*
file
imports
"./StyledForm"
StyledForm
"../../utils/dom"
filterByFocusable
"./FormProps"
IFormPropsIFormContextIFormErrorsIFormFieldProps

Stories

Main

On Submit

On Submit Error

On Invalid Form

valid