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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@botrun/chat

v0.0.32

Published

A chatroom for botrun.

Readme

BotrunChat Component

Introduction

The BotrunChat component is a comprehensive chat UI for React applications, featuring message display with various sender types, suggestion actions, custom code blocks, speech-to-text input, file uploads, and extensibility via remark plugins. It supports theming options for personalization.

Installation

npm install @botrun/chat
# or
yarn add @botrun/chat

To incorporate the correct import statement into the README.md's Usage section for the BotrunChat component, considering the adjustments made to your index.ts, you can update the documentation as follows:

Usage

To use the BotrunChat component in your project, first ensure that you import the component and any other necessary props or types that you plan to use. Below is an example showcasing how to set up the BotrunChat component within a React application:

import React, { useState } from 'react';
import BotrunChat, { MessageProps } from '@botrun/chat';

function App() {
  const [theme, setTheme] = useState<"dark" | "light">("dark");
  const [messages, setMessages] = useState<MessageProps[]>([]);
  // Additional state and function definitions for handling messages, file uploads, etc.
  // Function implementations for onMessageSend, handleSpeechToText, handleUploadFiles, etc.

  return (
    <BotrunChat
      theme={theme}
      onMessageSend={onMessageSend}
      messages={messages}
      // Include additional props as needed
    />
  );
}

export default App;

Props

This section outlines the props accepted by the BotrunChat component, including their data types, whether they are optional, and a brief description of each.

disabled (boolean, optional)

When true, it disables user interactions such as sending messages and uploading files. The default value is false.

messages (MessageProps[], required)

An array of message objects that the chat will display. Each MessageProps object contains details about the sender, content, and optional suggestions for the message.

onMessageSend ((message: string) => void, required)

A callback function that is called when a new message is sent. It receives the message content as a parameter.

handleSpeechToText ((file: File) => Promise<string>, optional)

A function for converting speech to text. It takes a File representing the audio file as input and returns a Promise that resolves to a string of the converted text. If the string is not empty, it will automatically be set in the input area.

handleUploadFiles ((files: FileList) => void, optional)

A function for handling file uploads. It receives a FileList of selected files as input.

assistantComponent (React.ReactElement | null, optional)

An optional React element to be used as an assistant component in the chat UI. This can be used to display custom messages or actions based on the chat's state (e.g., typing indicators, upload progress).

remarkPlugins (PluggableList | null | undefined, optional)

An optional list of remark plugins to extend the markdown rendering capabilities of the chat. This prop allows for customization of the text processing and rendering within the chat interface.

Each prop plays a crucial role in customizing and controlling the behavior of the BotrunChat component. By providing detailed information on each prop, developers can more easily understand how to effectively use the component in their projects.

layout ("default" | "chat", optional)

The layout prop determines the alignment of messages within the chat interface. If set to "default", all messages are aligned to the left. When set to "chat", messages from the user (self) are aligned to the right, while messages from others are aligned to the left. The default value for this prop is "default".

speedySpeech (boolean, optional)

The speedySpeech prop allows you to enhance the visual feedback of the speech-to-text functionality. When set to true, it changes the microphone icon to include a lightning symbol, indicating a "speedy" mode. The default value of this prop is false.

messagesOnly (boolean, optional)

When true, the InputContainer component will not be displayed, and only the messages will be shown. This is useful for scenarios where you want to present a read-only view of the chat history. The default value is false.

License

This project is licensed under the MIT License.