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

@e-llm-studio/uiexplainability

v1.0.18

Published

Interactive UI Component Library for Visualizing Thought Processes

Downloads

1,569

Readme

ThinkingResponse and Citation Components

Overview

This library provides two React components: ThinkingResponse and Citation. These components are designed for displaying response messages with optional animations and citations for enhanced user interaction and clarity.


ThinkingResponse Component

Purpose

The ThinkingResponse component is used to display a response message, with an expandable view and a thinking animation. It provides a flexible interface for handling response states, such as final responses or intermediary thinking states.

Props

| Prop Name | Type | Description | |---------------------|----------|-------------| | responseFrom | string | The source of the response. | | responseMessage | string | The content of the response message. Supports Markdown rendering. | | header_message | string | The message displayed in the header. | | finalResponseStatus | boolean | Indicates whether the response is final (true) or in-progress (false). | | thinkingBulbIcon | string | URL or path to the icon displayed for the thinking state. | | arrowDownIcon | string | URL or path to the arrow icon used for expanding/collapsing content. | | closeIcon | string (optional) | URL or path to the icon for closing the response. |

Example Usage

import ThinkingResponse from "./ThinkingResponse";

<ThinkingResponse
  responseFrom="Orchestrator"  // string
  responseMessage="This is a **sample response** rendered in Markdown." // string
  header_message="Orchestrator Thinking" // string
  finalResponseStatus={false} // string
  thinkingBulbIcon="/path/to/thinking-bulb-icon.png" // string
  arrowDownIcon="/path/to/arrow-down-icon.png" // string
/>

Features

  • Expandable Content: Toggle the response message with a smooth animation.
  • Markdown Support: Render the response message with Markdown formatting.
  • Customizable Icons: Replace the default icons with your own assets.

Citation Component

Purpose

The Citation component is designed to display a list of citations with expandable details, making it easy for users to view and navigate references.

Props

| Prop Name | Type | Description | |-------------------------------|-----------------------|-------------| | message | MessageType | The message containing citations and related metadata. | | fileIcon | string | Path or URL to the file icon. | | arrowDownIcon | string | Path or URL to the arrow icon for toggling citation details. | | containerClassName | string (optional) | Additional class names for the outer container. | | buttonClassName | string (optional) | Additional class names for the toggle button. | | citationClassName | string (optional) | Additional class names for individual citation items. | | citationDescriptionClassName| string (optional) | Additional class names for citation descriptions. | | citationMetadataClassName | string (optional) | Additional class names for citation metadata. |

MessageType Structure

interface CitationMetadata {
    page_index: number;
}

interface CitationType {
    citation_number?: number;
    title?: string;
    url?: string;
    description?: string;
    metadata: CitationMetadata;
}

interface MessageType {
    id?: string;
    role?: string;
    content?: string;
    citations?: CitationType[];
    citationDisplayType?: string;
}

Example Usage

import Citation from "./Citation";

const message = {
  citations: [
    {
      citation_number: 1,
      title: "Sample Citation",
      url: "https://example.com",
      description: "This is a detailed description of the citation.",
      metadata: {
        page_index: 12,
      },
    },
  ],
  citationDisplayType: "expanded",
};

<Citation
  message={message}
  fileIcon="/path/to/file-icon.png"
  arrowDownIcon="/path/to/arrow-down-icon.png"
/>

Features

  • Expandable Details: Toggle detailed descriptions and metadata for each citation.
  • Clickable Links: Open citation URLs in a new tab.
  • Customizable Styling: Add custom styles using the provided className props.

Installation

npm i @e-llm-studio/uiexplainability

Integration

  1. Import the required component:

    import ThinkingResponse from "your-library-name/ThinkingResponse";
    import Citation from "your-library-name/Citation";
  2. Provide the required props as per your use case.

  3. Add any additional styles if needed.


License

This library is licensed under MIT License.


Contributing

Contributions are welcome! Please submit a pull request or open an issue for any feature requests or bug fixes.