Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Infiniflow Ragflow FloatingChatWidgetMarkdown Component

From Leeroopedia
Revision as of 11:21, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Infiniflow_Ragflow_FloatingChatWidgetMarkdown_Component.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Frontend, Chat, Markdown
Last Updated 2026-02-12 06:00 GMT

Overview

Concrete Markdown renderer for embedded chat with citation support, syntax highlighting, and math formula rendering provided by the RAGFlow frontend.

Description

The FloatingChatWidgetMarkdown component renders AI-generated Markdown with citation references (popover with document thumbnails), syntax-highlighted code blocks, and LaTeX math support via rehype-katex and remark-math.

Usage

Import this component within the floating chat widget to render assistant message content with inline citation references and code formatting.

Code Reference

Source Location

Signature

export function FloatingChatWidgetMarkdown({
  reference,
  clickDocumentButton,
  content,
  loading,
}: {
  reference: IReference;
  clickDocumentButton?: (documentId: string, chunk: IReferenceChunk) => void;
  content: string;
  loading: boolean;
}): JSX.Element;

Import

import { FloatingChatWidgetMarkdown } from '@/components/floating-chat-widget-markdown';

I/O Contract

Inputs

Name Type Required Description
reference IReference Yes Citation reference data
content string Yes Markdown text to render
loading boolean Yes Whether content is still streaming
clickDocumentButton function No Callback when citation clicked

Outputs

Name Type Description
Rendered JSX JSX.Element Formatted Markdown with citations

Usage Examples

import { FloatingChatWidgetMarkdown } from '@/components/floating-chat-widget-markdown';

<FloatingChatWidgetMarkdown
  reference={messageRef}
  content={message.content}
  loading={isStreaming}
  clickDocumentButton={(docId, chunk) => openDocument(docId)}
/>

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment