Form Elements
The Starter Kit comes with a few Form Elements out of the box. More will be added along the way in the future.
TextInput
The standard input field that can be used for different types of data input.
It takes a few arguments as props:
type
(string) is the input type. E.g., 'text' or 'password'value
(any) is the value of the fieldname
(string) is the name of the fieldonChange
(function) is the invoked function on changeplaceholder
(string) is the placeholder text for the inputerrorMsg
(string). If this string is not empty, an error message will be displayed with the value of the string.
Examples:
<TextInput
type="text"
value=""
name="my-input"
onChange={()=>{}}
placeholder="This is my cool input"
errorMsg=""
/>
Password is invalid!
<TextInput
type="password"
value=""
name="my-input"
onChange={()=>{}}
placeholder="Your password"
errorMsg="Password is invalid!"
/>
TextArea
An HTML textarea element. It takes the followig arguments as props:
value
(any) is the value of the textareaname
(string) is the name of the elementonChange
(function) is the function executed on changeplaceholder
(string) is the placeholder texterrorMsg
(string). If this string is not empty, an error message will be displayed with the value of the string
Examples:
<TextArea
value=""
name"text-area"
onChange={()=>{}}
placeholder="My nice TextArea"
errorMsg=""
/>
The input is invalid
<TextArea
value=""
name="text-area"
onChange={()=>{}}
placeholder="My nice TextArea"
errorMsg="The input is invalid"
/>