
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@ai-react-markdown/mantine
Advanced tools
[](https://www.npmjs.com/package/@ai-react-markdown/mantine) [](https://www.npmjs.com/package/@ai-react-markdown/manti
Mantine UI integration for @ai-react-markdown/core. Provides a drop-in <MantineAIMarkdown> component that renders AI-generated markdown with Mantine-themed typography, syntax-highlighted code blocks, mermaid diagram support, and automatic color scheme detection.
<Typography> component for consistent theming@mantine/code-highlight (powered by highlight.js), including tabbed views with language labels, expand/collapse, and optional auto-detection for unlabeled blocksmermaid code blocks are rendered as interactive SVG diagrams with dark/light theme support, toggle to source view, copy, and open-in-new-windowuseComputedColorScheme) and passes it to the core renderer automaticallyem units, ensuring consistent scaling at any base font sizeAll core features (GFM, LaTeX math, CJK support, streaming, metadata context, content preprocessors, custom components) are inherited from @ai-react-markdown/core.
# npm
npm install @ai-react-markdown/mantine @ai-react-markdown/core
# pnpm
pnpm add @ai-react-markdown/mantine @ai-react-markdown/core
# yarn
yarn add @ai-react-markdown/mantine @ai-react-markdown/core
{
"react": ">=19",
"react-dom": ">=19",
"@ai-react-markdown/core": "^1.0.2",
"@mantine/core": "^8.3.17",
"@mantine/code-highlight": "^8.3.17",
"highlight.js": "^11.11.1"
}
Import the required stylesheets in your application entry point:
// Mantine core styles (required)
import '@mantine/core/styles.css';
// Mantine code highlight styles (required for code blocks)
import '@mantine/code-highlight/styles.css';
// Mantine AI Markdown styles (required for extra styles and mermaid)
import '@ai-react-markdown/mantine/styles.css';
// KaTeX styles (required for LaTeX math rendering)
import 'katex/dist/katex.min.css';
import { MantineProvider } from '@mantine/core';
import { CodeHighlightAdapterProvider, createHighlightJsAdapter } from '@mantine/code-highlight';
import hljs from 'highlight.js';
import MantineAIMarkdown from '@ai-react-markdown/mantine';
const highlightJsAdapter = createHighlightJsAdapter(hljs);
function App() {
return (
<MantineProvider>
<CodeHighlightAdapterProvider adapter={highlightJsAdapter}>
<MantineAIMarkdown content="Hello **world**! Math: $E = mc^2$" />
</CodeHighlightAdapterProvider>
</MantineProvider>
);
}
function StreamingChat({ content, isStreaming }: { content: string; isStreaming: boolean }) {
return <MantineAIMarkdown content={content} streaming={isStreaming} />;
}
MantineAIMarkdownProps<TConfig, TRenderData>Extends AIMarkdownProps from the core package. All core props are supported; listed below are the inherited props with Mantine-specific default overrides:
| Prop | Type | Default | Description |
|---|---|---|---|
content | string | (required) | Raw markdown content to render. |
streaming | boolean | false | Whether content is actively being streamed. |
fontSize | number | string | '0.875rem' | Base font size. Numbers are treated as pixels. |
variant | AIMarkdownVariant | 'default' | Typography variant name. |
colorScheme | AIMarkdownColorScheme | Auto-detected | Color scheme. Defaults to Mantine's computed color scheme. |
config | PartialDeep<TConfig> | undefined | Partial render config, deep-merged with defaults. |
defaultConfig | TConfig | defaultMantineAIMarkdownRenderConfig | Base config. |
metadata | TRenderData | undefined | Arbitrary data for custom components via dedicated context. |
contentPreprocessors | AIMDContentPreprocessor[] | [] | Additional preprocessors after the built-in LaTeX preprocessor. |
customComponents | AIMarkdownCustomComponents | Mantine defaults | Component overrides, merged with Mantine's built-in <pre> handler. |
Typography | AIMarkdownTypographyComponent | MantineAIMarkdownTypography | Typography wrapper. |
ExtraStyles | AIMarkdownExtraStylesComponent | MantineAIMDefaultExtraStyles | Extra style wrapper. |
The Mantine package extends the core AIMarkdownRenderConfig with additional options:
MantineAIMarkdownRenderConfigInherits all core config fields plus:
| Field | Type | Default | Description |
|---|---|---|---|
codeBlock.defaultExpanded | boolean | true | Whether code blocks start expanded. |
codeBlock.autoDetectUnknownLanguage | boolean | false | Use highlight.js to auto-detect language for unlabeled code blocks. |
<MantineAIMarkdown
content={markdown}
config={{
codeBlock: { defaultExpanded: false },
}}
/>
useMantineAIMarkdownRenderState<TConfig>()Typed wrapper around the core useAIMarkdownRenderState hook, defaulting to MantineAIMarkdownRenderConfig. Accepts an optional generic parameter for further extension.
import { useMantineAIMarkdownRenderState } from '@ai-react-markdown/mantine';
function MyCodeBlock() {
const { config, streaming, colorScheme } = useMantineAIMarkdownRenderState();
const isExpanded = config.codeBlock.defaultExpanded;
// ...
}
useMantineAIMarkdownMetadata<TMetadata>()Typed wrapper around the core useAIMarkdownMetadata hook, defaulting to MantineAIMarkdownMetadata. Accepts an optional generic parameter for further extension. Metadata lives in a separate React context from render state, so metadata updates do not cause re-renders in components that only consume render state.
import { useMantineAIMarkdownMetadata } from '@ai-react-markdown/mantine';
function MyComponent() {
const metadata = useMantineAIMarkdownMetadata();
// Access metadata fields
}
Code highlighting requires a CodeHighlightAdapterProvider wrapping your component tree. This is a Mantine requirement -- the adapter bridges highlight.js into Mantine's code highlight components.
import { CodeHighlightAdapterProvider, createHighlightJsAdapter } from '@mantine/code-highlight';
import hljs from 'highlight.js';
const highlightJsAdapter = createHighlightJsAdapter(hljs);
function App() {
return (
<CodeHighlightAdapterProvider adapter={highlightJsAdapter}>
{/* MantineAIMarkdown components can be rendered anywhere below */}
</CodeHighlightAdapterProvider>
);
}
By default, code blocks without an explicit language annotation render as plaintext. Enable auto-detection via config:
<MantineAIMarkdown content={markdown} config={{ codeBlock: { autoDetectUnknownLanguage: true } }} />
This uses highlight.js's highlightAuto to guess the language. Results may vary for short or ambiguous snippets.
Fenced code blocks with the mermaid language identifier are automatically rendered as interactive SVG diagrams:
```mermaid
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[OK]
B -->|No| D[Cancel]
```
Features:
The mermaid library is a direct dependency of this package -- no additional installation is needed.
MantineAIMarkdown automatically detects Mantine's computed color scheme using useComputedColorScheme('light'). You can override this by passing an explicit colorScheme prop:
// Automatic (default) -- follows Mantine's color scheme
<MantineAIMarkdown content={markdown} />
// Explicit override
<MantineAIMarkdown content={markdown} colorScheme="dark" />
The color scheme is passed to:
<AIMarkdown> component for typography themingCustom component overrides are merged with the Mantine defaults. Your overrides take precedence:
import MantineAIMarkdown from '@ai-react-markdown/mantine';
import type { AIMarkdownCustomComponents } from '@ai-react-markdown/core';
const customComponents: AIMarkdownCustomComponents = {
a: ({ href, children }) => (
<a href={href} target="_blank" rel="noopener noreferrer">
{children}
</a>
),
};
<MantineAIMarkdown content={markdown} customComponents={customComponents} />;
To override the default <pre> handler (and lose built-in code highlighting and mermaid support), include pre in your custom components.
MantineAIMarkdown -- the main component (memoized)MantineAIMarkdownTypography -- Mantine-themed typography wrapperMantineAIMDefaultExtraStyles -- default extra styles wrapper with Mantine CSS scopingMantineAIMarkdownPropsMantineAIMarkdownRenderConfigMantineAIMarkdownMetadatadefaultMantineAIMarkdownRenderConfig -- default Mantine render config (frozen)useMantineAIMarkdownRenderState<TConfig>() -- typed render state accessuseMantineAIMarkdownMetadata<TMetadata>() -- typed metadata accessFor base features, configuration options, content preprocessors, TypeScript generics, and architecture details, see the @ai-react-markdown/core README.
MIT
FAQs
[](https://www.npmjs.com/package/@ai-react-markdown/mantine) [](https://www.npmjs.com/package/@ai-react-markdown/manti
We found that @ai-react-markdown/mantine demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.