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

@katechat/ui

v1.0.18

Published

KateChat - AI Chat Interface modules collection

Readme

@katechat/ui

npm version License

KateChat - AI Chat Interface UI Components Library

A comprehensive collection of React components, hooks, and utilities for building AI chat interfaces. This package is extracted from the KateChat project to provide reusable UI modules for AI-powered chat applications.

Installation

npm install @katechat/ui

or

yarn add @katechat/ui

or

pnpm add @katechat/ui

Peer Dependencies

This package requires the following peer dependencies:

{
  "@mantine/carousel": "8.3.3",
  "@mantine/core": "8.3.3",
  "@mantine/dates": "8.3.3",
  "@mantine/form": "8.3.3",
  "@mantine/hooks": "8.3.3",
  "@mantine/modals": "8.3.3",
  "@mantine/notifications": "8.3.3",
  "@tabler/icons-react": "^3.1.0",
  "react": "19.1.0",
  "react-dom": "19.1.0",
  "react-redux": "^9.2.0",
  "react-router-dom": "^6.23.1"
}

Features

  • 🎨 Built with Mantine UI - Modern, accessible components
  • 💬 Chat Components - Ready-to-use chat message containers and lists
  • 🔌 Modular Architecture - Import only what you need
  • 🎯 TypeScript - Full type safety
  • 🪝 Custom Hooks - Reusable React hooks
  • 🎨 Theme Support - Customizable theming system
  • 📝 Markdown Support - Rich text rendering with code highlighting

Package Structure

This package is distributed with both ESM and CommonJS builds for maximum compatibility:

dist/
├── esm/           # ES Module build (import)
├── cjs/           # CommonJS build (require)
└── types/         # TypeScript type definitions

The package automatically uses the correct build format based on your bundler and module system.

Components

Chat Components (./components/chat)

  • ChatMessagesContainer - Container component for chat messages with scrolling behavior
  • ChatMessagesList - List component for rendering chat messages
  • Chat Input - Input components for user messages
  • Chat Message - Individual message display components

Modal Components (./components/modal)

  • ImagePopup - Modal for displaying images in fullscreen

Icon Components (./components/icons)

  • ProviderIcon - Icons for different AI providers (OpenAI, Anthropic, etc.)

Controls

File Controls (./controls)

  • FileDropzone - Drag-and-drop file upload component

Core Types & Utilities (./core)

Type definitions and utilities for:

  • Message Types - Chat message structures and interfaces
  • Model Types - AI model configurations and metadata
  • User Types - User profile and authentication types
  • AI Types - AI provider and configuration types

Hooks (./hooks)

Custom React hooks:

  • useIntersectionObserver - Detect element visibility for lazy loading and infinite scroll
  • useTheme - Access and manage application theme

Libraries (./lib)

  • Markdown Parser - Parse and render markdown with syntax highlighting
    • Supports code blocks with language detection
    • KaTeX math rendering
    • Syntax highlighting with highlight.js

Usage

Importing Styles

The package includes pre-bundled CSS with all Mantine styles. Import it in your main entry file:

// In your main SCSS file
@import "@katechat/ui/styles.css";

Or in your JavaScript/TypeScript:

// In your main entry file (e.g., index.tsx)
import "@katechat/ui/styles.css";

Basic Import

import { ChatMessagesContainer, ChatMessagesList, FileDropzone, useTheme, useIntersectionObserver } from "@katechat/ui";

Using Chat Components

import { ChatMessagesContainer, ChatMessagesList } from "@katechat/ui";

function ChatView({ messages }) {
  return (
    <ChatMessagesContainer>
      <ChatMessagesList messages={messages} />
    </ChatMessagesContainer>
  );
}

Using File Upload

import { FileDropzone } from "@katechat/ui";

function UploadArea() {
  const handleFileDrop = (files: File[]) => {
    console.log("Files uploaded:", files);
  };

  return <FileDropzone onDrop={handleFileDrop} />;
}

Using Custom Hooks

import { useTheme, useIntersectionObserver } from "@katechat/ui";

function MyComponent() {
  const { theme, setTheme } = useTheme();

  const { ref, isIntersecting } = useIntersectionObserver({
    threshold: 0.5,
  });

  return <div ref={ref}>{isIntersecting && <div>Element is visible!</div>}</div>;
}

Using Markdown Parser

import { parseMarkdown } from "@katechat/ui";

function MessageRenderer({ content }) {
  const html = parseMarkdown(content);

  return <div dangerouslySetInnerHTML={{ __html: html }} />;
}

Development

This package is part of the KateChat monorepo.

Building

npm run build

Type Checking

npm run typecheck

Testing

npm test

Formatting

npm run format

Dependencies

The package includes the following built-in dependencies:

  • highlight.js - Syntax highlighting for code blocks
  • i18next - Internationalization framework
  • lodash - Utility functions
  • marked - Markdown parser
  • marked-highlight - Syntax highlighting for marked
  • marked-katex-extension - KaTeX math rendering for marked

Contributing

Contributions are welcome! Please visit the main repository at https://github.com/artiz/kate-chat to contribute.

License

MIT

Links

Support

For questions, issues, or feature requests, please open an issue on the GitHub repository.


Made with ❤️ by the KateChat team