0.7.4 • Published 3 years ago
@slice-and-dice/govuk-react-input-field v0.7.4
InputField
Import
import InputField from '@govuk-react/input-field';
Usage
Simple
<InputField name="group0">National Insurance number</InputField>
Input with hint text
<InputField
name="group1"
hint={[
'It’s on your National Insurance card, benefit letter, payslip or P60.',
<br />,
'For example, ‘QQ 12 34 56 C’.',
]}
>
National Insurance number
</InputField>
Input with hint text & error
const meta = {
touched: true,
error: 'Example',
};
<InputField
name="group1"
hint={[
'It’s on your National Insurance card, benefit letter, payslip or P60.',
<br />,
'For example, ‘QQ 12 34 56 C’.',
]}
meta={meta}
>
National Insurance number
</InputField>
References:
- https://github.com/alphagov/govuk-frontend/blob/master/src/components/input/_input.scss
- https://github.com/alphagov/govuk_elements/blob/master/assets/sass/elements/_forms.scss
Properties
Prop | Required | Default | Type | Description |
---|---|---|---|---|
children | true | | node | ||
hint | undefined | node | ||
input | {} | shapeobject Object | ||
meta | {} | shapeobject Object |