This page documents the UI component architecture of the RAGFlow web frontend. The system leverages a multi-layered approach combining Ant Design for specialized layouts, Radix UI for accessible low-level primitives, and Tailwind CSS for utility-first styling. A specialized integration with React Flow powers the visual agent workflow editor, while React Hook Form and Zod provide a unified data layer for complex configurations.
RAGFlow's frontend architecture is built on a "best-of-breed" component strategy:
Select, Popover, Dialog, and Command. web/package.json42-67The following diagram illustrates how different libraries and custom components collaborate within the application shell and form systems.
Diagram: UI Component Hierarchy and Data Flow
Sources: web/src/components/chunk-method-dialog/index.tsx28-33 web/src/pages/dataset/dataset-setting/form-schema.ts3-5 web/src/components/ui/multi-select.tsx25-29 web/package.json75
The Input component integrates Tailwind styling with functional extensions like password toggles and search prefixes.
React.forwardRef to allow integration with react-hook-form. web/src/components/ui/input.tsx18-31Eye/EyeOff icons for password visibility and a prefixRef for dynamic padding calculation. web/src/components/ui/input.tsx35-49 web/src/components/ui/input.tsx129-147SearchInput provides a pre-configured search icon, and NumberInput ensures numeric type conversion. web/src/components/ui/input.tsx160-169 web/src/components/ui/input.tsx219-234Sources: web/src/components/ui/input.tsx18-31 web/src/components/ui/input.tsx129-147 web/src/components/ui/input.tsx160-234
RAGFlow uses Radix UI primitives to build accessible selection and overlay components.
MultiSelect component built on top of Radix Popover and Command primitives. It supports search, grouping, and custom icons. web/src/components/ui/multi-select.tsx198-223Select implementation providing SelectTrigger, SelectContent, and SelectItem. web/src/components/ui/select.tsx13-190Dialog components for creating datasets and configuring chunk methods. web/src/pages/datasets/dataset-creating-dialog.tsx6-12 web/src/components/chunk-method-dialog/index.tsx1-7Sources: web/src/components/ui/multi-select.tsx198-223 web/src/components/ui/select.tsx13-190 web/src/components/chunk-method-dialog/index.tsx1-7
The system utilizes a library of shared form components to ensure consistency across the application, particularly in the Agent and Dataset configuration views.
ChunkMethodItem: A standardized field for selecting the document parser (Naive, Manual, Book, etc.) with search capabilities. web/src/pages/dataset/dataset-setting/configuration/common-item.tsx56-99EmbeddingModelItem: Integrates ModelTreeSelect to ensure embedding models are correctly selected during dataset creation and editing. web/src/pages/dataset/dataset-setting/configuration/common-item.tsx157-210SliderInputFormField: A dual-input component combining a slider with a number input for precise value control (e.g., for threshold settings). web/src/components/slider-input-form-field.tsx34-139KnowledgeBaseFormField: A complex MultiSelect field that filters knowledge bases by embedding model compatibility. web/src/components/knowledge-base-item.tsx106-197Diagram: Form Field Component Relationships
Sources: web/src/pages/dataset/dataset-setting/configuration/common-item.tsx56-210 web/src/components/chunk-method-dialog/index.tsx35-48 web/src/pages/dataset/dataset-setting/index.tsx58-117 web/src/components/slider-input-form-field.tsx34-139 web/src/components/knowledge-base-item.tsx106-197
The ChunkMethodDialog serves as the primary interface for configuring how documents are processed. It dynamically renders fields based on the selected parser_id.
useWatch to monitor the parser_id and toggle visibility for fields like MaxTokenNumberFormField or LayoutRecognizeFormField. web/src/components/chunk-method-dialog/index.tsx191-208DataFlowSelect when parseType is set to Pipeline. web/src/components/chunk-method-dialog/index.tsx172-179Forms are governed by Zod schemas that define required fields and complex refinements.
formSchema to enforce that a pipeline_id is provided if the parse_type is set to Pipeline. web/src/pages/dataset/dataset-setting/form-schema.ts134-142InputForm, validation issues are added dynamically if ChunkMethodName is missing for built-in parsers. web/src/pages/datasets/dataset-creating-dialog.tsx63-83The FileUploader component provides a unified interface for document ingestion, supporting drag-and-drop and folder uploads.
useControllableState to manage file lists and progress reporting. web/src/components/file-uploader.tsx210-213Diagram: Dataset Configuration Data Flow
Sources: web/src/pages/datasets/dataset-creating-dialog.tsx45-83 web/src/components/chunk-method-dialog/index.tsx99-179 web/src/pages/dataset/dataset-setting/form-schema.ts5-142 web/src/components/file-uploader.tsx189-252
The Agent Canvas utilizes specific form implementations for each node type, such as the CategorizeForm.
DynamicCategorize component allows users to define multiple categorization branches within an agent node. web/src/pages/agent/form/categorize-form/index.tsx15 web/src/pages/agent/form/categorize-form/dynamic-categorize.tsxFormWrapper to maintain consistent padding and layout for all agent operator forms. web/src/pages/agent/form/categorize-form/index.tsx38-49useCreateCategorizeFormSchema. web/src/pages/agent/form/categorize-form/index.tsx25-30Sources: web/src/pages/agent/form/categorize-form/index.tsx22-50
Refresh this wiki
This wiki was recently refreshed. Please wait 4 days to refresh again.