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

@dyno-assistant/ui

v0.1.3

Published

Chat UI components for Dyno Assistant

Readme

@openassistant/ui

The React chat component for OpenAssistant.

Installation

npm install @openassistant/ui

Add the chat component to your app

import { AiAssistant } from '@openassistant/ui';
// Only needed for React apps without TailwindCSS
// import '@openassistant/ui/dist/bundle.css';

function App() {
  return (
    <AiAssistant
      modelProvider="openai"
      model="gpt-4"
      apiKey="your-api-key"
      version="0.0.1"
      welcomeMessage="Hello! How can I help you today?"
      instructions="You are a helpful assistant."
      functions={{}}
    />
  );
}

TailwindCSS Configuration

If you're using TailwindCSS, configure your tailwind.config.js to include the necessary UI components:

import { heroUI } from '@hero-ui/react';

module.exports = {
  content: [
    // your original content
    './node_modules/@openassistant/ui/dist/**/*.{js,ts,jsx,tsx}',
    './node_modules/@hero-ui/react/dist/**/*.{js,ts,jsx,tsx}',
  ],
  darkMode: 'class',
  plugins: [heroUI()],
};

Theme

The UI supports both light and dark themes using theme prop.

<AiAssistant
  ...theme="dark"
/>

Tools

The chat component supports tools by default, and it uses @openassistant/core package to call LLMs with tools that helps the LLM to answer the user's question. The tool execution result will be rendered in the chat component by default.

See 📁 examples/zod_function_tools and 📁 examples/multisteps_tools for a complete example.

If you don't want to show the tool execution result, you can set showTools prop to false.

<AiAssistant
  tools={{}}
   ...showTools={false}
/>

Messages

The chat component is stateful, you can use initialMessages prop to set the initial messages. If you want to manage the chat messages for e.g. persistence, you can use onMessagesUpdated prop.

<AiAssistant
   ...initialMessages={[]}
   onMessagesUpdated={(messages) => {
    // Do something with the messages
   }}
/>

See examples/message_persistent for a complete example.

Markdown

The chat component supports markdown rendering by default, you can configure it by setting useMarkdown prop.

<AiAssistant
   ...useMarkdown={false}
/>

Avatar

The chat component supports avatar by default, you can configure it by setting userAvatar and assistantAvatar props. If you don't want to show the avatar, you can set showAvatar prop to false.

<AiAssistant
   ...userAvatar={<Avatar />}
   ...assistantAvatar={<Avatar />}
   ...showAvatar={true}
/>

AbortController

The chat component has a built-in abort controller that controls stop and restart the chat. You can also pass your own abort controller to the chat component by setting abortController prop.

const abortController = new AbortController();

<AiAssistant
   ...abortController={abortController}
   onRestartChat={() => {
    // Do something after the chat is restarted
   }}
/>