0.1.0 • Published 2 years ago

react-chat-interface v0.1.0

Weekly downloads
7
License
MIT
Repository
github
Last release
2 years ago

React Chat

last commit downloads size license

screenshot

React Chat is a simple chat interface for React with a focus on high customizability.

Installation

npm i --save react-chat-interface

Example

In order to see the examples and play with the configuration, clone/fork this repository and run storybook

git clone https://github.com/thinkty/react-chat.git
cd react-chat
npm i
npm run storybook

Props

NameDescriptionRequiredDefaultTypes
messagesarray of message itemsMessage[]
onSubmitcallback function to be called when submit button or ctrl-enter has been pressed(content: string) => void
heightheight of the ReactChat component500pxstring
widthwidth of the ReactChat component300pxstring
autoScrollToBottomscroll to bottom on mount and on new messagetruebool
senderStyleCSS property for the sender namestyles.tsCSS
primaryStyleCSS property for message sent by the ownerstyles.tsCSS
secondaryStyleCSS property for message sent by othersstyles.tsCSS
allowEmptySubmitIf true, allow onSubmit to be triggered even if content is emptyfalsebool
textAreaStyleCSS property for the text-area inputstyles.tsCSS
enableSubmitButtonIf true, display submit buttontruebool
enableCtrlEnterSubmitIf true, enable submit by pressing ctrl-entertruebool
submitButtonColorColor of the submit button on non-hover state#DCDCDCstring
submitButtonStyleCSS property for the submit buttonstyles.tsCSS
submitButtonHoverColorColor of the submit button on hover state#B3B3B3string
submitButtonHoverStyleCSS property for the submit button on hover statestyles.tsCSS

License

MIT