This component will be removed soon.
Replaced by Input and ValidationFormGroup
InputText
minimal usage#
<InputText name="name" label="First Name" value="Foo Bar" />
read only#
<InputText name="inputState" label="Input State" value="Read Only" readOnly />
validation#
<InputTextid="username"name="username"label="Username"description="The unique name that identifies you throughout the site."validator={value => {let feedback = { isValid: true };if (value.length < 3) {feedback = {isValid: false,validationMessage: 'Username must be at least 3 characters in length.',};}return feedback;}}/>
validation with danger theme#
<InputTextname="username"label="Username"description="The unique name that identifies you throughout the site."validator={value => {let feedback = { isValid: true };if (value.length < 3) {feedback = {isValid: false,validationMessage: 'Username must be at least 3 characters in length.',dangerIconDescription: 'Error',};}return feedback;}}themes={['danger']}/>
label as element#
<InputTextname="username"label={<span lang="en">Element</span>}value="Label is wrapped in language span"/>
focus test#
class FocusInputWrapper extends React.Component {constructor(props) {super(props);this.state = { open: true };this.resetStatusAlertWrapperState = this.resetStatusAlertWrapperState.bind(this,);}resetStatusAlertWrapperState() {this.setState({ open: false });this.inputForm.focus();}render() {return (<div><StatusAlertalertType="info"open={this.state.open}dialog="Close me to input data!"onClose={this.resetStatusAlertWrapperState}/><InputTextid="data"name="data"label="Data Input"inputRef={input => {this.inputForm = input;}}/></div>);}}
different textual input types#
<form><InputTextname="search"label="Search"value="what is paragon"type="search"id="input-search"/><InputTextname="email"label="Email"value="paragon@edx.org"type="email"id="input-email"/><InputTextname="url"label="Url"value="https://edx.github.io/paragon"type="url"id="input-url"/><InputTextname="telephone"label="Telephone"value="1-(555)-555-5555"type="tel"id="input-tel"/><InputTextname="password"label="Password"value="hunter2"type="password"id="input-password"/><InputTextname="number"label="Number"value={42}type="number"id="input-number"/><InputTextname="datetime-local"label="Date and time"value="2017-04-27T13:45:00"type="datetime-local"id="input-datetime-local"/><InputTextname="date"label="Date"value="2017-04-27"type="date"id="input-date"/><InputTextname="month"label="Month"value="2017-04"type="month"id="input-month"/><InputTextname="week"label="Week"value="2017-W33"type="week"id="input-week"/><InputTextname="time"label="Time"value="13:45:00"type="time"id="input-time"/><InputTextname="color"label="Color"value="#BF472C"type="color"id="input-color"/></form>
price with step#
<InputTextname="price"label="Price"type="number"value={3.5}min={0}step={0.01}/>
displayed inline#
<InputText name="username" label="Username" value="foobar" inline />
with input group addons#
<form><InputTextname="username"label="Username"value="foobar"inputGroupPrepend={<div className="input-group-text">{'@'}</div>}/><InputTextname="username"label="Username"value="foobar"inputGroupAppend={<div className="input-group-text">{'@example.com'}</div>}/><InputTextname="money"label="Money"type="number"value={1000}inputGroupPrepend={<div className="input-group-text">{'$'}</div>}inputGroupAppend={<div className="input-group-text">{'.00'}</div>}/><InputTextname="search"label="Search"value="what is paragon"inputGroupAppend={(<Button variant="outline-secondary">Go</Button>)}/><InputTextname="username"label="Username"value="foobar"inputGroupAppend={[<div className="input-group-text"><Iconid="checkmark"className="fa fa-check"screenReaderText="Checkmark"/></div>,<Button variant="outline-secondary">Go</Button>,]}/><InputTextname="password"label="Password"value="secret"inputGroupAppend={<div className="input-group-text"><Iconid="checkmark"className="fa fa-check"screenReaderText="Checkmark"/></div>}/></form>