Text Field
Overview
Text fields allow users enter and edit text. This component can be used for both short and long form entries.
The text field component is the workhorse of the input fields. It's used for all common text entry and can be safely used to take both single word responses as well as long-form text entry. Switching between single line or multi-line entries can be done with the multiline prop.
When to use
- Textfield should be used when data entry of alpha-numeric input is required in both short and long forms.
When not to use
- Do not use Text Field when requiring pure numeric values, please use the Number field component instead.
- Do not use the Text Field to allow data entry of dates or times. Instead use DateTime, Date or Time where appropriate.
Interactive demo
The demo below allows you to preview the component. You can play with its props, variations, configuration options and dive into its events and even see them trigger in the event log tab.
MedKit Text Field
Error
string
Error Hidden
boolean
false
Help Text
string
Array<string>
Label
string
Required
Label Hidden
boolean
false
Multiline
boolean
false
Placeholder
string
Required
boolean
false
Type
string
text
Char Limit
number
Rows
number
1
Multi-line text entry
Where required multiple lines of text can be entered by enabling the multiline prop. Note that by default the multiline feature auto-sizes the field to the data entry.
Tell me everything
This is a textarea with rows set to 3
Error
Missing information
What is your life story is required
Figma Library
You can find the component in our MedKit Figma library.