Skip to main content

Button

Button Component

May need to button component in chat apps. It can be define very easily.

Example Usage

import { Button } from "react-chat-elements";


<Button text={"Send"} onClick={() => alert("Sending...")} title="Send" />;
<Button text={"Send"} onClick={() => alert("Sending...")} type='transparent' title="Send" />;
<Button
text={"Send"}
onClick={() => alert("Sending...")}
title="Send"
icon ={
float:'left',
size:15,
component:<IconExample/>
}/>

Result

Button Props

propdefaulttypedescription
typenonestringbutton type (outlined, transparent)
disablednonestringbutton is disabled ?
textnonestringbutton text
buttonRefnonefunctionbutton ref
titlenonestringbutton title (Hover over the button to see the title.)
classNamenonestringclassName for optional Button
backgroundColor#3979aastringbutton background color
color#ffffffstringbutton color
onClicknonefunctionbutton onClick event
iconnoneobjectbutton icon (see details below)

Button Icon Props

propdefaulttypedescription
floatnonestringspan float
size12numberfont size number
componentnoneReactChildicon componentc