GithubHelp home page GithubHelp logo

syunto07ka / react-file-showable-chat-ui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from varmil/react-file-showable-chat-ui

0.0 0.0 0.0 1.2 MB

๐Ÿ™Š[Revised Edition] Chat UI with uploaded files can be showable

Home Page: https://brandonmowat.github.io/react-chat-ui/demo/

License: MIT License

TypeScript 99.88% Shell 0.12%

react-file-showable-chat-ui's Introduction

๐Ÿ™Š react-file-showable-chat-ui

The revised edition of original react-chat-ui.

A library of React components for building chat UI's.

NPM

Features

  • Auto scroll to bottom
  • SUPER easy to use
  • Multiple user grouping (try it out in the demo)

Keep in mind that this project is still in the early stages of development. If you encounter a bug or have a feature request, please create an issue and/or tweet at me here.

Installation

npm install react-file-showable-chat-ui --save

Basic Usage

import { ChatFeed, Message } from 'react-file-showable-chat-ui'

// Your code stuff...

render() {

  return (
    <ChatFeed
      messages={this.state.messages} // list of message objects
      isTyping={this.state.is_typing} // Boolean: is the recipient typing
      hasInputField={false} // Boolean: use our input, or use your own
      showSenderName // show the name of the user who sent the message
      bubblesCentered={false} //Boolean should the bubbles be centered in the feed?
      // JSON: Custom bubble styles
      bubbleStyles={
        {
          text: {
            fontSize: 30
          },
          chatbubble: {
            borderRadius: 70,
            padding: 40
          }
        }
      }
    />

    // Your JSX...

  )

}

Make sure to keep a list of proper message objects in your class state. Like so:

//...
this.state = {
  messages: [
    new Message({
      id: 1,
      message: "I'm the recipient! (The person you're talking to)",
    }), // Gray bubble
    new Message({ id: 0, message: "I'm you -- the blue bubble!" }), // Blue bubble
  ],
  //...
};
//...

API

Development

# terminal A
npm run watch

# then terminal B
# NOTE: you must disable cache in your browser
npm run demo

react-file-showable-chat-ui's People

Contributors

brandonmowat avatar varmil avatar bookercodes avatar unvalley avatar tpisto avatar josowsky avatar natsukingdom avatar hakamata-rui avatar sibelius avatar ohing504 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.