A pack of extensions for grommet 2
created:7/7/2021
updated:7/7/2021
loc
13
comments
23%
passed
2
failed
4
coverage
100%

TextInputField

Component

import { TextInputField } from 'grommet-controls';

Validation

() => (
<Form
onSubmit={() => console.log('onSubmit')}
pad={{ horizontal: 'small' }}
focusFirstChild={false}
>
<TextInputField
label="Zip code"
name="zip_code"
validation={[
validators.required(),
validators.numeric(),
validators.minLength(5),
]}
/>
<Box pad="small">
<Button type="submit" label="Submit" />
</Box>
</Form>
)

Commits

Date
Author
Commit Message
8/30/2020

atanasster

avatar of atanasster
update eslint and add component-controls
8/27/2019

atanasster

avatar of atanasster
initial commit 2.x alpha
2 commits

External dependencies

package
imports
peer
grommet
^2.15.0
TextInputPropsTextInput
*
Omit
*
react
^17.0.1
React
*

Internal dependencies

file
imports
"../WithFormField"
WithFormFieldIWithFormFieldProps

Component JSX

<WithFormField
>
WithFormField
from"../WithFormField"
<TextInput
/>
grommet
^2.15.0

Stories

Main

() => (
<Form
onSubmit={() => console.log('onSubmit')}
pad={{ horizontal: 'small' }}
focusFirstChild={false}
>
<TextInputField
label="City"
name="city"
validation={[validators.required()]}
/>
<Box pad="small">
<Button type="submit" label="Submit" />
</Box>
</Form>
)

In Field

() => (
<Form
onSubmit={() => console.log('onSubmit')}
pad={{ horizontal: 'small' }}
focusFirstChild={false}
>
<TextInputField
label="City"
name="city"
inField={false}
validation={[validators.required()]}
/>
<Box pad="small">
<Button type="submit" label="Submit" />
</Box>
</Form>
)