
Product
Socket for ClickUp Is Now Available
Create ClickUp tasks from Socket alerts, automate ticketing with custom rules, and keep alert and task status synchronized.
@markdown-ui/react
Advanced tools
React renderer for markdown-ui widgets. This package provides React components that work with the markdown-ui widget system.
npm install @markdown-ui/react @markdown-ui/marked-ext
import React from 'react';
import { MarkdownUI } from '@markdown-ui/react';
import '@markdown-ui/react/widgets.css'; // Optional styling
import { marked } from 'marked';
import { markedUiExtension } from '@markdown-ui/marked-ext';
// Configure marked with the UI extension
marked.use(markedUiExtension);
const App = () => {
const markdown = `
# My Form
\`\`\`markdown-ui-widget
{
"type": "textInput",
"label": "Your Name",
"placeholder": "Enter your name"
}
\`\`\`
`;
const html = marked(markdown);
const handleWidgetEvent = (data: any) => {
console.log('Widget event:', data);
};
return (
<MarkdownUI
html={html}
onWidgetEvent={handleWidgetEvent}
/>
);
};
All widgets from the Svelte implementation are available:
\`\`\`markdown-ui-widget
{
"type": "textInput",
"label": "Name",
"placeholder": "Enter your name",
"default": "John Doe"
}
\`\`\`
\`\`\`markdown-ui-widget
{
"type": "buttonGroup",
"label": "Choose an option",
"choices": ["Option A", "Option B", "Option C"],
"default": "Option A"
}
\`\`\`
\`\`\`markdown-ui-widget
{
"type": "slider",
"label": "Value",
"min": 0,
"max": 100,
"step": 1,
"default": 50
}
\`\`\`
\`\`\`markdown-ui-widget
{
"type": "form",
"submitLabel": "Submit Form",
"fields": [
{
"type": "textInput",
"id": "name",
"label": "Name",
"placeholder": "Your name"
},
{
"type": "select",
"id": "country",
"label": "Country",
"choices": ["USA", "Canada", "UK"]
}
]
}
\`\`\`
Import the CSS file for default styling:
import '@markdown-ui/react/widgets.css';
You can also customize the styling by overriding the CSS classes:
.widget - Base widget container.widget-form - Form container.widget-button-group - Button group container.widget-button - Text input container.selector - Select dropdown container.selector-multi - Multi-select container.widget-slider - Slider containerThe onWidgetEvent callback receives data when widget values change:
const handleWidgetEvent = (data: { id: string, value: any }) => {
console.log(`Widget ${data.id} changed to:`, data.value);
};
This package includes full TypeScript definitions. All components are typed and provide IntelliSense support.
Due to the use of Web Components and browser APIs, this library requires client-side rendering. Use dynamic imports with SSR disabled:
import dynamic from 'next/dynamic';
const MarkdownUI = dynamic(() => import('@markdown-ui/react').then(mod => ({ default: mod.MarkdownUI })), {
ssr: false
});
export default function Page() {
const handleWidgetEvent = (data: any) => {
console.log('Widget event:', data);
};
return (
<MarkdownUI
html={yourProcessedHtml}
onWidgetEvent={handleWidgetEvent}
/>
);
}
FAQs
React renderer for markdown-ui
The npm package @markdown-ui/react receives a total of 63 weekly downloads. As such, @markdown-ui/react popularity was classified as not popular.
We found that @markdown-ui/react 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.

Product
Create ClickUp tasks from Socket alerts, automate ticketing with custom rules, and keep alert and task status synchronized.

Product
Create and manage Asana tasks directly from Socket alerts, with manual task creation, automated ticketing rules, and two-way sync.

Security News
Open VSX has removed three extension IDs from its malicious-extension list as the legitimate publishers they impersonated move to claim the names for themselves.