Lynx Markdown
This guide covers Lynx's official <markdown> native element. For basic rendering, replace content with text. Styles, events, and native selection features need separate adapters.
Migrate with an agent
Send this prompt to an agent with access to your project:
Replace the element
Install in an existing ReactLynx project:
Before, using the project's existing <markdown> type declarations and native registration:
After:
Fluxdown renders with Lynx elements such as view and text. Your project's @lynx-js/react-rsbuild-plugin compiles the package's JSX, and importing the component loads its styles. Keep the outer scroll-view or message list; see quick start.
Adjust styles and streaming
Replace markdown-style with theme.tokens for content styles. Keep outer dimensions and spacing in style:
For example, move markdown-style.normalText.fontSize to the body font size setting; Fluxdown sizes use strings with units. Adjust headings, code, and paragraph spacing in the corresponding theme groups.
Always pass accumulated text. Set pending to false when the request completes, is cancelled, or fails. Its boolean direction is the opposite of content-complete. Do not pass through animation-type, animation-velocity, or markdown-effect; see streaming content for smooth output and trailing effects.
Reconnect interactions and custom content
Connect the original events through slot plugins, calling your app's existing bridge methods:
Fluxdown does not resolve inlineview:// to child views automatically. Migrate that content explicitly, and check custom <span>/<p> styles and image size extensions against real content.
There are no matching top-level props for text-selection, text-maxline, selection menus, or native methods such as getSelectedText. Adapt those features or retain the original element where needed. FluxdownRef exposes rendering results, not a native element reference. Remove Markdown-specific host registrations and dependencies only when no pages still use them.