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

@antdigital/agentui-react-native

v0.1.5

Published

Agent UI components for React Native — Markdown renderer with streaming

Readme

@antdigital/agentui-react-native

React Native UI for agent chat, aligned with @ant-design/agentic-ui where it matters: Markdown (unified → HAST → React Native) and a minimal message list (simplified BubbleList).

Features

| Module | Description | |--------|-------------| | MarkdownRenderer | GFM markdown, block-level streaming (sealed/tail), optional character throttle | | MessageList | FlatList chat UI: user right / assistant left, each body uses MarkdownRenderer |

Not included (see agentic-ui on web): avatars, like/dislike/copy, thought chain, Mermaid, math, Slate editor, plugin code routers.

Requirements

  • React >= 18
  • React Native >= 0.73

Install

npm install @antdigital/agentui-react-native

Peer dependencies: react, react-native.

Markdown pipeline packages (unified, remark-*, hast-util-to-jsx-runtime, …) are bundled into lib/ at publish time so Metro does not need package.exports or extra resolver config. Host apps only install this package plus react / react-native.

Quick start

Wrap your tree in MarkdownThemeProvider once (required for markdown colors/typography).

import {
  MarkdownThemeProvider,
  MessageList,
  type ChatMessage,
} from '@antdigital/agentui-react-native';

const messages: ChatMessage[] = [
  { id: '1', role: 'user', content: 'Hello' },
  {
    id: '2',
    role: 'assistant',
    content: '## Hi\n\nMarkdown **works**.',
    isFinished: true,
  },
];

export function ChatScreen() {
  return (
    <MarkdownThemeProvider>
      <MessageList messages={messages} autoScrollToBottom />
    </MarkdownThemeProvider>
  );
}

MarkdownRenderer

Renders a markdown string as native View / Text (and related primitives).

import { MarkdownRenderer, MarkdownThemeProvider } from '@antdigital/agentui-react-native';

<MarkdownThemeProvider>
  <MarkdownRenderer content="# Title\n\nParagraph with **bold**." />
</MarkdownThemeProvider>

Supported (GFM subset): headings, paragraphs, bold/italic/strike, links, lists, task lists, blockquote, inline/fenced code, tables, horizontal rule, images (URL).

Agent cards: fenced block with language agent-card and a JSON body — rendered as a structured card (or override via components.agentCard):

```agent-card
{"title":"BTC-PERP","highlight":"72,732.45 · -2.63%","fields":[{"label":"24h","value":"+3.2%"}]}
```

Streaming (SSE / token stream)

<MarkdownRenderer
  content={partialMarkdown}
  streaming
  isFinished={streamDone}
  throttleOptions={{ enabled: true, charsPerFrame: 3 }}
/>
  • Character throttle — shows text gradually as content grows.
  • Block split — finished blocks stay cached (sealed); only the last block re-parses often (tail).
  • throttleOptions.fade — accepted for API parity with web; no visual effect on React Native.

Use on the last assistant message in a list via ChatMessage.streaming / isFinished (see below).

MessageList

Minimal chat list: no toolbar actions, no avatars.

ChatMessage

| Field | Type | Notes | |-------|------|--------| | id | string | Stable key for FlatList (host assigns; do not change while streaming) | | role | 'user' \| 'assistant' | Layout: user right, assistant left | | content | string | Markdown source | | streaming? | boolean | Usually last assistant message only | | isFinished? | boolean | When true, throttle flushes remaining text |

MessageList props

| Prop | Default | Description | |------|---------|-------------| | messages | — | Array of ChatMessage | | autoScrollToBottom | true | Scroll when length or last content changes | | throttleOptions | — | Passed to each bubble’s MarkdownRenderer | | chatTheme | defaultChatTheme | Bubble colors, padding, gap (mergeChatTheme) | | style / contentContainerStyle | — | FlatList styles |

<MessageList
  messages={messages}
  autoScrollToBottom
  throttleOptions={{ enabled: true }}
  chatTheme={{ userBubbleBackground: '#e6f4ff' }}
/>

Single-message layout: use MessageBubble + MarkdownRenderer directly (both exported).

API exports

| Export | Description | |--------|-------------| | MarkdownRenderer | Markdown → RN tree | | MessageList / MessageBubble | Chat list / single row | | useMarkdownToReact | Hook (block streaming pipeline) | | markdownToReactSync | Sync parse (tests) | | useContentThrottle | Character throttle only | | MarkdownThemeProvider / defaultTheme | Markdown typography & colors | | defaultChatTheme / mergeChatTheme | Bubble chrome | | createHastProcessor, splitMarkdownBlocks, shouldReparseLastBlock | Advanced / streaming internals |

Types: ChatMessage, MessageListProps, MarkdownRendererProps, ContentThrottleOptions, ChatTheme, MarkdownTheme, …

Example app (Expo)

From repo root:

npm install
cd example && npm install
npm run example

Or: npm run example from root.

The example includes:

  • MessageList — static thread + “Stream reply” (assistant streaming in the list)
  • Streaming only — single MarkdownRenderer demo

Details: example/README.md.

Debug: breakpoints in example/*.tsx or src/**; Metro resolves the library via react-nativesrc/index.ts.

Develop

npm install
npm run typecheck
npm test
npm run build

Output: lib/ (published main / types). Local Expo example uses src/ via Metro watchFolders.

Relation to agentic-ui

| Web (agentic-ui) | This package | |--------------------|--------------| | MarkdownRenderer + remark/rehype plugins | Slim processor (GFM only) | | BubbleList / PureBubbleList | MessageList | | Ant Design, CSS fade tokens | RN View/Text, no fade |

License

MIT