Styled composite component displaying an input with a label and hint text and error text depending on props.


0.10.014 days ago4 years agoMinified + gzip package size for @govuk-react/input-field in KB




  import InputField from '@govuk-react/input-field';

Use the text input component when you need to let users enter text that’s no longer than a single line, such as their name or phone number.


Prop Required Default Type Description
error `````` boolean Apply error state styling to the component
hint undefined ReactNode
input {} InputProps
margin `````` Margin Margin[]
mb `````` string number
meta {} { error?: string string[]; touched?: boolean; }
padding `````` Padding Padding[]

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.