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
| prop | default | type | description |
|---|---|---|---|
| type | none | string | button type (outlined, transparent) |
| disabled | none | string | button is disabled ? |
| text | none | string | button text |
| buttonRef | none | function | button ref |
| title | none | string | button title (Hover over the button to see the title.) |
| className | none | string | className for optional Button |
| backgroundColor | #3979aa | string | button background color |
| color | #ffffff | string | button color |
| onClick | none | function | button onClick event |
| icon | none | object | button icon (see details below) |
Button Icon Props
| prop | default | type | description | |
|---|---|---|---|---|
| float | none | string | span float | |
| size | 12 | number | font size number | |
| component | none | ReactChild | icon component | c |