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

@saimnasser/react-native-chatlist

v1.0.6

Published

A flexible, animated, and customizable Chat UI component for React Native.

Readme

react-native-chatlist

License: MIT Platform: iOS / Android NPM Version


A flexible, animated, and customizable Chat UI component for React Native.
Built on top of react-native-reanimated and react-native-keyboard-controller.


✨ Features

✅ Animated keyboard gestures ✅ Flexible message rendering
✅ Built-in simple input component
✅ Infinite scroll (top reach detection)
✅ Type-safe message array with generic support
✅ Easy to use with default message type or your own message type


📦 Requirements

  • react-native-reanimated >= 3.x
  • react-native-keyboard-controller (latest version)

🛠 Installation

npm install react-native-chatlist react-native-reanimated react-native-keyboard-controller

Additional Setup


💻 Usage

Basic Example (using default message type)

import React, { useRef } from 'react';
import { ChatUI, type ChatUIRef, type TMessage } from 'react-native-chatlist';

const messages: TMessage[] = [
  {
    id: '1',
    message: 'Hello!',
    name: 'Alice',
    time: '10:00 AM',
    isMine: false,
  },
  {
    id: '2',
    message: 'Hi there!',
    name: 'You',
    time: '10:01 AM',
    isMine: true,
  },
];

export default function App() {
  const chatRef = useRef<ChatUIRef>(null);

  const handleSend = (newMessage: string) => {
    console.log('Send:', newMessage);
    // Add your logic to append the message to `messages`
  };

  return (
    <ChatUI
      ref={chatRef}
      messages={messages}
      onSendPress={handleSend}
      keyExtractor={(item) => item.id}
    />
  );
}

⚙️ Custom Message Type

The component is generic — it accepts a type parameter T.

👉 If you do not provide a type parameter, it will use this default TMessage:

export type TMessage = {
  id: string;
  message: string;
  name: string;
  time: string;
  image?: string;
  isMine: boolean;
};

👉 If you want to use your own message shape, pass it as a type parameter:

type CustomMessage = {
  id: string;
  message: string;
  name: string;
  time: string;
  avatarUrl?: string;
  isMine: boolean;
};

const messages: CustomMessage[] = [
  // your messages
];

<ChatUI<CustomMessage>
  messages={messages}
  keyExtractor={(item) => item.id}
  renderMessage={(item) => (
    <CustomChatBubble item={item} />
  )}
/>;

Summary:

| Usage | Behavior | | --------------------------------- | -------------------------------- | | <ChatUI ... /> | Uses TMessage | | <ChatUI<MyCustomMessage> ... /> | Uses your type MyCustomMessage |


🔠 Props

| Prop | Type | Default | Description | | -------------------------- | ----------------------------------------- | ------------ | ---------------------------------------------- | | messages | T[] (defaults to TMessage[]) | required | Array of message objects | | keyExtractor | (item: T, index: number) => string | required | Function to extract unique key from messages | | onSendPress | (message: string) => void | optional | Called when user presses Send | | renderMessage | (item: T, index: number) => ReactNode | optional | Custom render function for messages | | renderInput | () => ReactNode | optional | Custom input component | | onTopReachedThreshold | number | optional | Threshold to trigger onTopReached | | onTopReached | () => void | optional | Called when top of chat is reached | | ListEmptyComponent | () => ReactNode | optional | Component to show when messages array is empty | | myMessageContainerStyle | ViewStyle | optional | Style for "my" message container | | otherContainerStyle | ViewStyle | optional | Style for "other" message container | | myMessageTextStyle | TextStyle | optional | Style for "my" message text | | otherMessageTextStyle | TextStyle | optional | Style for "other" message text | | myTimeTextStyle | TextStyle | optional | Style for "my" message time | | otherTimeTextStyle | TextStyle | optional | Style for "other" message time | | myNameTextStyle | TextStyle | optional | Style for "my" message name | | otherNameTextStyle | TextStyle | optional | Style for "other" message name | | All other FlatList props | Supported via spread (...FlatListProps) | | You can pass standard FlatList props |


🧭 Ref API

You can use ref to control scrolling:

type ChatUIRef = {
  scrollToTop: ({ animated }: { animated: boolean }) => void;
};

Example usage:

chatRef.current?.scrollToTop({ animated: true });

📦 Components Exported

import { ChatBubble, Input } from 'react-native-chatlist';
  • ChatBubble — the default message bubble component
  • Input — the default input component used if renderInput is not provided

📝 License

MIT