• English
  • Configuration

    Basic usage follows React. The table links to the full reference for each prop; Taro's style usage is covered below.

    PropTypeDefault and purpose
    textstringRequired. The complete current Markdown.
    streamingboolean | StreamingConfigfalse. Ending repair, smoothing, and effects.
    buildBaseBuildConfig{}. Parsing features such as math and footnotes.
    themeTheme'light'. A preset or partial overrides; see the styling guide.
    pluginsIPluginItem | IPluginItem[][]. Extends the Taro preset; required for Raw.
    patchesIPatchItem<ReactNode>[][]. Inserts or replaces text with Taro components.
    classNamestringundefined. Additional class name on the outer View.
    stylestring | CSSPropertiesundefined. An object or style string for the outer View.
    refRef<FluxdownRef>undefined. A handle to reactive render output, not a view reference.
    Imports

    Import BaseBuildConfig, StreamingConfig, Theme, and FluxdownRef from @fluxdown/taro; IPluginItem from @fluxdown/react-base-plugins/typings; IPatchItem from @fluxdown/core; and CSSProperties, ReactNode, and Ref from react.

    style Optional

    Type: string | CSSProperties

    Default: undefined

    Styles for the outer Taro View. Accepts an object or a CSS declaration string, following Taro's style prop. Use className to apply styles from your app:

    <Fluxdown
      className="conversation-message"
      style={{ padding: '16px', maxWidth: '720px' }}
      text={text}
    />

    The same styles can be passed as a string:

    <Fluxdown style="padding: 16px; max-width: 720px" text={text} />

    Use the styling guide for colors and typography within the content.

    Components and plugins

    To change components or interactions, return Taro components from slot plugins or a patch's render function.

    Full and Lite include different Taro plugins; see the plugin matrix. Full uses Prism for code highlighting. For formulas, it tries KaTeX through Taro RichText, then falls back to MathJax SVG through Taro Image, and finally to the source if rendering fails. Presentation follows the target platform's support for rich text and SVG images.