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 RAGFlowFormItem Component

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

Overview

Concrete reusable form item wrapper integrating react-hook-form Controller with label, tooltip, and layout control provided by the RAGFlow frontend.

Description

The RAGFlowFormItem component wraps react-hook-form's Controller with a label/tooltip header and horizontal/vertical layout support. It accepts children as either a ReactNode or a render function receiving the Controller field props.

Usage

Import this component as the standard form field wrapper throughout the RAGFlow frontend to ensure consistent form field rendering with labels and validation.

Code Reference

Source Location

Signature

export function RAGFlowFormItem({
  name, label, tooltip, children,
  horizontal, required, labelClassName, className, rules,
}: {
  name: string;
  label?: ReactNode;
  tooltip?: ReactNode;
  children: ReactNode | ((field: ControllerRenderProps) => ReactNode);
  horizontal?: boolean;
  required?: boolean;
  labelClassName?: string;
  className?: string;
  rules?: UseControllerProps['rules'];
}): JSX.Element;

Import

import { RAGFlowFormItem } from '@/components/ragflow-form';

I/O Contract

Inputs

Name Type Required Description
name string Yes Form field name for react-hook-form binding
label ReactNode No Field label
children ReactNode/function Yes Field content or render function
horizontal boolean No Use horizontal layout

Outputs

Name Type Description
Rendered JSX JSX.Element Form field with label and Controller

Usage Examples

import { RAGFlowFormItem } from '@/components/ragflow-form';
import { Input } from '@/components/ui/input';

<RAGFlowFormItem name="title" label="Title" required>
  <Input placeholder="Enter title" />
</RAGFlowFormItem>

<RAGFlowFormItem name="model" label="Model" tooltip="Select the LLM">
  {(field) => <Select {...field} options={modelOptions} />}
</RAGFlowFormItem>

Related Pages

Page Connections

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