Text Input
React
import { TextInput } from '@sky-uk/ui-core';
TextInput
is a form component that maps closely to the native input
element and supports all of the same attributes. (See MDN).
It doesn't support checkbox
or radio
types, these types can be achieved using Control Field instead.
Please refer to the Field documentation for a fully composed example with label and in-line messaging.
Props
Masking
You can use a mask to autoformat the user's input by passing a string to the mask
prop using the following formatting rules:
9
for numbersa
for letters*
for any alphanumeric character- Any other characters will prefill
System Modifiers
The TextInput
component accepts props applied using the following system modifiers:
Accessibility
Please refer to the W3C Forms Concepts guide when working with forms.