npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-chatflow

v0.1.25

Published

ReactNative Chatflow Component

Readme

ReactNative Chat Flow

ReactNative component that helps you to quickly and easily build interactive chat applications.

Installation

npm install --save react-native-chatflow

Note: this package requires react-native-linear-gradient. It is part of the dependencies of the package so will be automatically installed, but note that you will need to run the following command to link it as it is a native module:

react-native link react-native-linear-gradient

Basic Usage

It's really easy to get started. Put the following code in one of your components...


import ChatFlow from "react-native-chatflow";
import chatScript from "./chatScript.json";

<ChatFlow 
    chatScript={chatScript}
    backgroundColor={Styles.colours.lightBackground}

Then you need to include a chat script (in the example above, chatScript.json), which defines what the chat flow will be. An example is shown below:

{
    "_start": "hello",
    "hello": {
        "text": "Hello I'm an example bot 👋🏼",
        "next": "getName"
    },
    "getName": {
        "text": "First up, what's your name?",
        "input": "text",
        "placeholder": "Enter your name",
        "field": "name",
        "next": "favouriteEmoji"
    },
    "favouriteEmoji": {
        "text": "What food do you want?",
        "field": "food",
        "options": [
            {"value": "small", "text": "🥕"},
            {"value": "medium", "text": "🍕"},
            {"value": "big", "text": "🐔"}
        ]
    }
}

Properties/Options

Name | Description ---------------- | ------------------------------- chatScript | The chat script JSON object images | Map of static images to use in chats backgroundColor | Background color of the chat holder userBubbleStyle | Object with styles for the user bubble userBubbleTextStyle | Object with styles for the user bubble text botBubbleTextStyle | Object with styles for the bot bubble bubbleOptionStyle | Object with styles for the option bubble bubbleOptionTextStyle | Object with styles for the option bubble text (the options shown at the bottom of the screen) textInputStyle | Text styles for the text input box hidden | If set to true, the chat component will be hidden onRenderComponent | Method that renders custom components (see below) onChangeAnswers | Event fired when the user answers a question or clicks an option onChangeField(field, value) | Event fired when a user changes a field onChatHistoryChange | Event fired when the chat history changes (i.e. when the user or bot speaks) getChatHistory | Method that returns the chat history

Loading existing chat history

If you need to load chat history, create a ref on your component and then call chatFlow.loadChatHistory(chats)