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

@nuvui/chat

v0.1.3

Published

Conversation components for @nuvui/react: messages, markdown and code, a prompt box that takes files, sources, tool calls, reasoning and the list of past conversations.

Readme

@nuvui/chat

The parts of a conversation with an assistant, for @nuvui/react: messages, the scrolling around them, the box a prompt is written in, and what a reply comes with: files, sources, tool calls and reasoning. And the list of past conversations.

This is early: the package is on npm as a 0.x version, and before 1.0 a minor version may rename or remove things. The changelog says where one does, and the repository README says where things stand.

pnpm add @nuvui/chat @nuvui/react
"use client";

import "@nuvui/react/styles.css";
import "@nuvui/chat/styles.css";
import {
  Conversation,
  ConversationContent,
  ConversationScrollButton,
  Message,
  MessageContent,
  MessageLoader,
  PromptInput,
  PromptInputSubmit,
  PromptInputTextarea,
  PromptInputToolbar,
} from "@nuvui/chat";

export function Chat({ messages, waiting, replying, send, stop }) {
  return (
    <Conversation style={{ blockSize: "100dvh" }}>
      <ConversationContent aria-label="Conversation">
        {messages.map((message) => (
          <Message
            key={message.id}
            from={message.role}
            streaming={replying && message === messages.at(-1)}
          >
            <MessageContent>{message.text}</MessageContent>
          </Message>
        ))}
        {waiting ? (
          <Message from="assistant" streaming>
            <MessageLoader />
          </Message>
        ) : null}
      </ConversationContent>
      <ConversationScrollButton />
      <PromptInput busy={waiting || replying} onStop={stop} onSubmit={send}>
        <PromptInputTextarea aria-label="Message" placeholder="Ask anything" />
        <PromptInputToolbar>
          <PromptInputSubmit />
        </PromptInputToolbar>
      </PromptInput>
    </Conversation>
  );
}

What's in it

  • Conversation: the messages in a box that scrolls. It starts at the latest message and keeps it in view while a reply arrives. When the reader scrolls up, it stops following, and a button to go back appears.
  • Message: one message, from the person or from the assistant, with room for a picture, a line of details and a row of actions. MessageCopyAction copies it.
  • MessageLoader: three dots for the wait before a reply starts.
  • Markdown, at @nuvui/chat/markdown: a reply's markdown drawn with the library's type. HTML in the text is shown as text, pictures aren't loaded unless you say so, and text that's still arriving is drawn as what it's about to be.
  • CodeBlock: code with its language and a button that copies it. Colors come from a highlighter you plug in, and one for Shiki is ready at @nuvui/chat/shiki.
  • PromptInput: the box a prompt is written in. The field grows with its text, Enter sends, and the button to send becomes a button to stop while a reply is on its way. With PromptInputAttach and PromptInputAttachments it takes files, picked, pasted or dropped, and hands them over with the text.
  • PromptSuggestion: prompts to start from.
  • Attachment: a file, in a message or waiting to be sent.
  • Sources: what a reply was drawn from, as a numbered list of links that opens.
  • ToolCall: something the assistant did with a tool, in a card that opens, with a question and two buttons for a call that has to be allowed first.
  • Reasoning: the steps the assistant took, open while it works and closed after.
  • ThreadList: the list of past conversations, for a sidebar.

What it leaves to you

It takes messages as props and tells you when something is sent. It doesn't talk to a model or to a server, and it doesn't upload a file: it hands you the File objects. So it works with whatever you fetch with.

MessageContent shows text with its line breaks and takes whatever you render yourself. For a model's reply, put a Markdown in it.

For a screen reader

The messages are a log: a message is read when it's added. One that's still arriving is marked as busy with streaming and read once it's whole. Each starts with who it's from, in words that are read and not seen. The tests check the roles, names and states. What each screen reader then says hasn't been checked by a person.

Dependencies

@nuvui/react is a peer dependency. The parts that open are built on its Collapsible, and the thread list on its ListView.

Two things come from outside, each for one entry:

  • @nuvui/chat/markdown reads markdown with react-markdown and remark-gfm. They're installed with the package and loaded only by an app that imports that entry, which is about 42 kB compressed. Markdown isn't exported from @nuvui/chat for that reason. Both are ESM only: with require, that entry needs Node 20.19, or 22.12 and later.
  • @nuvui/chat/shiki uses Shiki, an optional peer dependency. Install it if you use that entry.

The docs are at https://nuvui.nuvraxis.com/docs/chat.

License

MIT