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-pro-messenger

v1.1.4

Published

Telegram-style chat component for React

Readme

React Pro Messenger

A feature-rich chat component with Telegram-inspired UI and modern messaging features.

Chat Interface Preview image image


Features ✨

Core Functionality

  • Telegram-style messaging interface
  • Multi-user chat support
  • Message history with scroll
  • Responsive design

Message Types

  • Text messages with formatting
  • Voice messages with audio player
  • File attachments (images, documents)
  • Symbol integration (@mentions, #tasks)

Interactive Features

  • Context menu for message actions
  • Delete/edit message functionality
  • Dynamic symbol recognition:(for example :)
    • @ for user mentions
    • # for task references
  • Animated message transitions

Installation 📦

npm install react-pro-messenger

or

yarn add react-pro-messenger

note : for now you need to install taiwlind in your project for this package to have proper style. and then in tailwind configuration you should have this

content: ["./node_modules/react-pro-messenger/**/*.{html,js, jsx}"],

Basic Usage 🚀

import { Chat, MessageEntity } from "react-pro-messenger";

const App = () => {
  const [messages, setMessages] = useState<MessageEntity[]>(initialMessages);
  const currentUser = { id: "user-1", fullName: "John Doe" };

  return (
    <Chat
      messages={messages}
      user={currentUser}
      onMessageSent={(newMsg) => setMessages([...messages, newMsg])}
      onDeleteMessage={(id) =>
        setMessages(messages.filter((msg) => msg.id !== id))
      }
    />
  );
};

Component Props ⚙️

Chat Component Configuration

| Prop | Type | Default | Description | | -------------------------- | ----------------------------- | ------------ | ------------------------- | | messages | MessageEntity[] | Required | Array of message objects | | user | UserInterface | Required | Current user details | | width | string | "400px" | Container width | | height | string | "600px" | Container height | | dynamicSymbolAssignments | SymbolAssignmentInterface[] | [] | Symbol-component mappings | | className | string | "" | Additional CSS classes |

Key:
📌 Type = Expected prop type
📌 Default = Default value if not required
📌 Required = Must be provided

Customization 🎨

Symbol Integration

const taskComponent = ({ listsProps, onClick }) => (
  <div className="task-item">
    <span>📌</span>
    <p>{listsProps.name}</p>
  </div>
);

<Chat
  dynamicSymbolAssignments={[
    {
      symbol: "#",
      component: taskComponent,
      lists: tasksList,
    },
  ]}
/>;

Basic Usage 💻

Copy;
import { Chat, MessageEntity } from "react-pro-messenger";
import { useState } from "react";

function App() {
  const [messages, setMessages] = useState<MessageEntity[]>([]);
  const currentUser = { id: "user-1", fullName: "John Doe" };

  return (
    <div className="h-[600px] w-[400px]">
      <Chat
        messages={messages}
        user={currentUser}
        onMessageSent={(newMsg) => setMessages([...messages, newMsg])}
        onDeleteMessage={(id) =>
          setMessages(messages.filter((msg) => msg.id !== id))
        }
      />
    </div>
  );
}

Dynamic Symbol Integration (@/#) 🔠

Copy;
import { Tasks, User } from "react-pro-messenger";

// In your main component
<Chat
  dynamicSymbolAssignments={[
    {
      symbol: "#",
      component: ({ listsProps, onClick }) => (
        <Tasks task={listsProps} onClick={onClick} />
      ),
      lists: yourTasksList,
    },
    {
      symbol: "@",
      component: ({ listsProps, onClick }) => (
        <User user={listsProps} onClick={onClick} />
      ),
      lists: yourUsersList,
    },
  ]}
/>;

Sending Messages Example 📩

Copy;
// Create new message
const newMessage = new MessageEntity({
  id: Date.now().toString(),
  text: "Hello World!",
  createdDate: new Date().toISOString(),
  user: currentUser,
  isRightSided: true,
});

// Add to messages array
setMessages((prev) => [...prev, newMessage]);

Advanced Features 🚀

  1. Custom Styling
<Chat
  className="custom-chat-styles"
  dynamicSymbolAssignments={
    [
      /*...*/
    ]
  }
  // Add Tailwind classes or CSS modules
  style={{
    "--message-bg": "#f0f4ff",
    "--user-color": "#1a237e",
  }}
/>
  1. Context Menu Handling
const handleDelete = (messageId: string) => {
  setMessages(messages.filter((msg) => msg.id !== messageId));
};

const handleEdit = (messageId: string) => {
  // Your edit logic
};

<Chat onDeleteMessage={handleDelete} onEditMessage={handleEdit} />;

Contributing 🤝

Fork the repository💻

Github link click me

Create feature branch:

git checkout -b feature/new-feature

Commit changes:

git commit -m 'Add awesome feature'

Push to branch:

git push origin feature/new-feature

Open a Pull Request

License 📜 MIT License © 2023 [mahdij98]