Skip to main content

Component <Input />

Props

PropsTypeMeaningPossible values
inputSizestringChange input sizesm / md
layoutstringChange input general stylesfilled / outlined
shapestringChange borders shaperounded / squared
labelstringAdd input labelstring
msgstringAdd message below the input. Color depends on statusstring
statusstringSet input statussuccess / error
iconBeforenodeAdd icont before the textelement
iconAfternodeAdd icont after the textelement



States

Examples:

<Input placeholder="Enter some text..." />
<Input placeholder="Enter some text..." disabled />



Sizes

Examples:

<Input inputSize="sm" placeholder="Enter some text..." />
<Input inputSize="md" placeholder="Enter some text..." />



Shape

Examples:

<Input shape="rounded" placeholder="Enter some text..." />
<Input shape="squared" placeholder="Enter some text..." />



Layouts

Examples:

<Input layout="filled" placeholder="Enter some text..." />
<Input layout="outlined" placeholder="Enter some text..." />



With label

Example:

<Input label="Enter some text" placeholder="Here..." />



Statuses and message

Examples:

<Input msg="Just type somethig" placeholder="Enter some text..." />
<Input msg="Well done!" placeholder="Enter some text..." status="success" />
<Input msg="Try again" placeholder="Enter some text..." status="error" />
Just type somethig
Well done!
Try again



With icons

Examples:

<Input iconBefore={<i className="icon-search" />} placeholder="Enter some text..." />
<Input iconAfter={<i className="icon-info" />} placeholder="Enter some text..." />
<Input iconAfter={<i className="icon-x-mark" />} iconBefore={<i className="icon-heart" />} placeholder="Enter some text..." />



With mask

Examples:

<Input mask="***-***-***" />
<Input mask="(**)***-**-**" value={98} onChange={event => console.log(event)} />