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

@tdesign-react/chat

v1.1.0

Published

TDesign Pro Component for AIGC

Readme

TDesign AIGC Components for React Framework

📦 Installation

# npm
npm install @tdesign-react/chat

# yarn
yarn add @tdesign-react/chat

# pnpm
pnpm add @tdesign-react/chat

依赖要求: React >= 18.0.0

🔨 Quick Start

一体化组件集成

直接使用 ChatBot 组件,内置完整的 UI 结构和交互逻辑,适合快速集成标准聊天界面。

import React from 'react';
import { ChatBot } from '@tdesign-react/chat';
import '@tdesign-react/chat/es/style/index.js';

export default function App() {
  return (
    <ChatBot
      chatServiceConfig={{
        endpoint: 'https://your-api-endpoint.com/chat',
        stream: true,
      }}
    />
  );
}

组合式开发

通过 useChat Hook 自由组合 UI 组件,适合需要深度定制 UI 结构和交互逻辑的场景。

import React from 'react';
import { useChat, ChatList, ChatMessage, ChatSender } from '@tdesign-react/chat';
import '@tdesign-react/chat/es/style/index.js';

export default function CompositeChat() {
  const { chatEngine, messages, status } = useChat({
    chatServiceConfig: {
      endpoint: 'https://your-api-endpoint.com/chat',
      stream: true,
    },
  });

  return (
    <>
      <ChatList>
        {messages.map((message) => (
          <ChatMessage key={message.id} message={message} />
        ))}
      </ChatList>
      <ChatSender
        loading={status === 'streaming'}
        onSend={(e) => chatEngine.sendUserMessage({ prompt: e.detail.value })}
        onStop={() => chatEngine.abortChat()}
      />
    </>
  );
}

协议配置

支持自定义协议和AG-UI 标准协议两种模式:

| 场景 | 推荐协议 | | ------------------ | ---------- | | 快速集成到现有服务 | 自定义协议 | | 构建复杂 AI 应用 | AG-UI 协议 | | 多工具调用场景 | AG-UI 协议 |

// 通过 onMessage 解析数据
const customConfig = {
  endpoint: '/api/chat',
  protocol: 'agui', // 开启 AG-UI 协议,自动解析标准事件
  onMessage: (chunk) => chunk.data,
};

📖 体验示例和完整文档

Browser Support

| IE / Edge | Firefox | Chrome | Safari | | --------- | ------------ | ----------- | ------------- | | Edge >=84 | Firefox >=83 | Chrome >=84 | Safari >=14.1 |

Contributing

Contributing is welcome. Read guidelines for contributing before submitting your Pull Request.

Feedback

Create your Github issues or scan the QR code below to join our user groups

License

The MIT License. Please see the license file for more information.