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

@ai-markdown/react-mantine

v3.2.2

Published

Mantine UI integration for ai-markdown React: typography, code highlighting and Mermaid diagrams.

Readme

@ai-markdown/react-mantine

Documentation · Examples · Website

@ai-markdown/react-mantine stable @ai-markdown/react-mantine monthly downloads TypeScript declarations included MIT license

React 19 Mantine 9

Add Mantine presentation to the React Markdown renderer: themed typography, highlighted and expandable code, source-preserving JSON formatting, and Mermaid diagrams. Parsing, URL policy, metadata and document coordination follow the React adapter.

Compatibility

  • React and React DOM ^19.0.0.
  • @mantine/core and @mantine/code-highlight ^9.0.0.
  • highlight.js ^11.11.2 is an optional peer. The package never imports it; install it for Mantine's highlight.js adapter (the Quick Start). An app that highlights with another adapter (Shiki) can leave it out.
  • A compatible @ai-markdown/react peer; upgrade the React adapter and integration together. See the declared peer range.
  • Node ^20.19.0 || >=22.12.0 for server/build consumers.
  • This integration is React-only. Vue applications use @ai-markdown/vue.

Installation

pnpm add @ai-markdown/react-mantine @ai-markdown/react \
  react@^19 react-dom@^19 @mantine/core@^9 @mantine/code-highlight@^9 \
  highlight.js@^11.11.2 katex

Quick Start

import { MantineProvider } from '@mantine/core';
import { CodeHighlightAdapterProvider, createHighlightJsAdapter } from '@mantine/code-highlight';
import hljs from 'highlight.js';
import MantineAIMarkdown from '@ai-markdown/react-mantine';
import '@mantine/core/styles.css';
import '@mantine/code-highlight/styles.css';
import '@ai-markdown/react-mantine/styles.css';
import 'katex/dist/katex.min.css';

const adapter = createHighlightJsAdapter(hljs);

export function Answer() {
  return (
    <MantineProvider>
      <CodeHighlightAdapterProvider adapter={adapter}>
        <MantineAIMarkdown content="Hello **world**! Math: $E = mc^2$" />
      </CodeHighlightAdapterProvider>
    </MantineProvider>
  );
}

Both providers and the stylesheet imports are part of this setup. KaTeX CSS is required for the math example. Keep the adapter object stable. Replacing the pre renderer transfers code formatting, copy, highlighting and diagram behavior to your component.

Language auto-detection for unlabelled fences is on by default and uses @ai-markdown/code-language-detector, a dependency of this package, so it needs no further setup. Detection is synchronous and runs during render, server rendering included. A block the detector cannot place with confidence stays plaintext labelled "unknown", and the detector never overrides an explicit fence language. codeBlock.languageFormat names your adapter (highlight.js by default), and every language, whether written on the fence or detected, is handed to the highlighter in that adapter's spelling: ```objc reaches highlight.js as objectivec, and ```txt reaches Shiki as text. The tab label keeps the name as written:

<MantineAIMarkdown content={content} /> // detection is on by default
// with Mantine's Shiki adapter:
// codeBlock={{ languageFormat: MantineLanguageFormat.Shiki }}
// to keep unlabelled blocks plaintext:
// codeBlock={{ autoDetectUnknownLanguage: false }}

Mermaid renders while streaming are throttled by codeBlock.mermaidIntervalMs (default 300 ms; the final source always renders once streaming ends), and input above mermaid's maxTextSize shows an error instead of a placeholder diagram.

Documentation

The independent site owns the detailed API and guides. This README provides the package's minimal installation and usage path.

License

MIT