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

glchat-a2ui-react-renderer

v0.1.0

Published

A2UI (Agent-to-UI) React renderer for GLChat — render declarative UI from AI agent messages

Readme

glchat-a2ui-react-renderer

@a2ui-sdk/react with GLChat-specific catalog and styling.

This package provides:

  • GlchatA2UIProviderA2UIProvider wrapper that uses the GLChat catalog by default.
  • GlchatA2UIRenderer – thin wrapper around A2UIRenderer.
  • glchatStandardCatalog – the standard A2UI catalog with GLChat custom components (Button, Card, Timeout) for manual wiring.
  • Tailwind themingstyles/globals.css, styles/theme-v4.css, and tailwind-config.cjs for default tokens and utilities.

This library provides GLChat-specific components and styling while remaining fully compatible with the upstream A2UI renderer.


Prerequisites

  • React 18+
  • Tailwind CSS v3 or v4

Install

npm install glchat-a2ui-react-renderer

Quick Start

Use the GLChat-aware wrappers:

import {
  GlchatA2UIProvider,
  GlchatA2UIRenderer,
  type A2UIMessage,
  type A2UIAction,
} from 'glchat-a2ui-react-renderer';

function App() {
  const messages: A2UIMessage[] = [
    // A2UI messages from your backend
  ];

  const handleAction = (action: A2UIAction) => {
    console.log('Action received:', action);
  };

  return (
    <GlchatA2UIProvider messages={messages}>
      <GlchatA2UIRenderer onAction={handleAction} />
    </GlchatA2UIProvider>
  );
}

Custom Catalog

To extend catalog, you can use glchatStandardCatalog as the base standard.

import {
  A2UIProvider,
  A2UIRenderer,
  glchatStandardCatalog,
  type A2UIMessage,
  type A2UIAction,
} from 'glchat-a2ui-react-renderer';

function App() {
  const messages: A2UIMessage[] = [
    // A2UI messages from your backend
  ];

  const customCatalog = {
    ...glchatStandardCatalog,
    components: {
      ...glchatStandardCatalog.components,
      Button: CustomButtonComponent,
    },
  };

  const handleAction = (action: A2UIAction) => {
    console.log('Action received:', action);
  };

  return (
    <GlchatA2UIProvider messages={messages} catalog={glchatStandardCatalog}>
      <GlchatA2UIRenderer onAction={handleAction} />
    </GlchatA2UIProvider>
  );
}
import {
  ComponentRenderer,
  type ButtonComponentProps,
  type CatalogComponent,
  useDispatchAction,
} from "glchat-a2ui-react-renderer";

export const CustomButtonComponent: CatalogComponent = ({
  surfaceId,
  componentId,
  ...props
}) => {
  const { child, action, primary } = props as ButtonComponentProps
  const dispatchAction = useDispatchAction()

  const handleClick = () => {
    if (action) {
      dispatchAction(surfaceId, componentId, action)
    }
  }

  const variant  = primary ? 'primary' : 'outline';

  return (
    <Button onClick={handleClick} variant={variant}>
      <div>masuk custom button</div>
      {child && <ComponentRenderer surfaceId={surfaceId} componentId={child} />}
    </Button>
  )
}

Refer to the upstream docs for full API details: https://a2ui.org/renderers/


Tailwind Setup

Tailwind v4

Add the following to your main CSS file (globals.css):

@import "tailwindcss";

/* Load design tokens */
@import "glchat-a2ui-react-renderer/styles/globals.css";

/* Register tokens with Tailwind */
@import "glchat-a2ui-react-renderer/styles/theme-v4.css";

/* Optional: ensure Tailwind scans this package */
@source "../node_modules/glchat-a2ui-react-renderer";

Tailwind v3

Use the provided preset and include the package in content.

const glchatPreset = require('glchat-a2ui-react-renderer/tailwind-config.cjs');

module.exports = {
  presets: [glchatPreset],
  content: [
    './src/**/*.{js,ts,jsx,tsx}',
    './app/**/*.{js,ts,jsx,tsx}',
    './node_modules/glchat-a2ui-react-renderer/dist/**/*.{js,jsx,ts,tsx}',
  ],
};

Import the tokens in your main CSS:

@import "glchat-a2ui-react-renderer/styles/globals.css";

@tailwind base;
@tailwind components;
@tailwind utilities;

Customizing Colors

Override CSS variables after importing globals.css:

:root {
  --primary: 220 90% 45%;
  --background: 0 0% 99%;
}

.dark {
  --primary: 220 70% 50%;
}

You may also extend the theme via:

  • tailwind.config.js (v3)
  • @theme (v4)

Exports

GLChat wrappers

  • GlchatA2UIProviderProps
  • GlchatA2UIRendererProps

GLChat catalog

  • glchatStandardCatalog – standard catalog with custom Button, Card, Timeout

Re-exports from @a2ui-sdk/react

Components

  • A2UIProvider
  • A2UIRenderer
  • ComponentRenderer
  • standardCatalog

Hooks

  • useDispatchAction
  • useDataBinding
  • useFormBinding
  • useSurfaceContext
  • useDataModelContext
  • useA2UIMessageHandler

Context

  • ActionProvider
  • useActionContext

Types

  • A2UIMessage
  • A2UIAction
  • Action
  • ValueSource
  • A2UIProviderProps
  • A2UIRendererProps
  • A2UIMessageHandler

Styles

  • styles/globals.css
  • styles/theme-v4.css
  • tailwind-config.cjs

Full documentation: https://a2ui.org/renderers/


License

MIT