Code Monkey home page Code Monkey logo

react-talkbot's Introduction

React TalkBot

npm

Convey your message to your users through displaying a beautiful animation. Visit the repo here.

Working Demo

Installation

$ npm i react-talkbot

Usage

    import { TalkBox } from 'react-talkbot';

    const msgDemo = [
        {
            sent: false,
            msg: "Hi, How can I build an impressive resume?",
        },
        {
            sent: true,
            msg: "Hello, Do you have a good Github Profile?",
        },
        {
            sent: false,
            msg: "Yeah, I do have one. All of my projects are on Github.",
        },
        {
            sent: true,
            msg:
            "Cool, You can head over to <a href='https://resume-github.vercel.app' style='color: #74c'>https://resume-github.vercel.app</a> and generate a resume with your username.",
        },
        {
            sent: false,
            msg: "Ohh, wow! I'll check it out.",
        },
        {
            sent: true,
            msg: "and the best part is you can customize it too.",
        },
        {
            sent: false,
            msg: "Great, Thanks buddy :)",
        },
    ];

    const App = () => {
        return (
            <div>
                // some code here
                <TalkBox
                    messages={messages}
                    senderAvatar={"๐Ÿง‘๐Ÿป"}
                    receiverAvatar={"๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป"}
                    containerStyle={{background: "antiquewhite", borderColor: "gainsboro"}}
                    msgWrapperStyle={{borderRadius: "24px"}}
                />
            </div>
        )
    }

API and Configuration

Property Type Default Description
messages Array some messages An array of objects where an object has two properties:
sent - Boolean(true when message is shown on right side as if one sent it)
msg - String(text which would be displayed, could also contain HTML tags, those will be parsed.)
senderAvatar Text(any emoticon) ๐Ÿง‘๐Ÿป An emoticon to display as sender profile
receiverAvatar Text(any emoticon) ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป An emoticon to display as receiver profile
containerStyle Object These styles would be applied to the container/screen on the back-side
msgWrapperStyle Object These styles would be applied to single message div on which text is displayed
sentMsgWrapperStyle Object These styles would be applied to message div displayed on sent end
receivedMsgWrapperStyle Object These styles would be applied to message div displayed on received end

react-talkbot's People

Contributors

satyam1203 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.