Skip to main content

Input

Input Component

Input component should be used to write a message.

Example Usage

import { Input } from 'react-chat-elements'

<Input
placeholder="Type here..."
multiline={true}
/>

Result

Input Props

propdefaulttypedescription
typetextstringinput type if multiline is false
referancenoneobjectinput ref
classNamenonestringoptional input className
placeholdernonestringinput placeholder text
defaultValuenonestringinput default value
onChangenonefunctioninput onChange function
multilinefalseboolinput is textarea
autoHeighttrueboolinput auto height
minHeight25intinput min height
maxHeight200intinput max height
inputStylenoneobjectinputStyle object
leftButtonsnoneobject(component)left buttons component
rightButtonsnoneobject(component)right buttons component
maxlengthnoneintinput or textarea maxlength
onMaxLengthExceednonefunctioncalled when max length exceed
autofocusfalseboolinput autofocus
clearnonefunctioninput clear func if it has referance
onCopynonefunctioninput onfunction event
onCutnonefunctioninput oncut event
onPastenonefunctioninput onpaste event
onSelectnonefunctioninput onselect event
onBlurnonefunctioninput onblur event
onFocusnonefunctioninput onfocus event
onSubmitnonefunctioninput onsubmit event
onResetnonefunctioninput onreset event
onKeyDownnonefunctioninput onkeydown event
onKeyPressnonefunctioninput onkeypress event
onKeyUpnonefunctioninput onkeyup event