From 5e7eb834b3d8476063d265dfaef6da1575a2a6ee Mon Sep 17 00:00:00 2001 From: Mendon Kissling <59585235+mendonk@users.noreply.github.com> Date: Tue, 28 Oct 2025 12:12:53 -0400 Subject: [PATCH] docs: update custom component docs (#10323) * add-partial * update-lfx-component-paths * move-partial * completed-quickstart * clean up intro * try-docker-with-custom-mount * up-to-typed-annotations * typed-annotations * dynamic-fields * end-of-file * bundles-naming * chore: update component index --------- Co-authored-by: github-actions[bot] --- .../components-custom-components.mdx | 771 +++++++++--------- .../Contributing/contributing-bundles.mdx | 20 +- .../contributing-component-tests.mdx | 29 +- .../Contributing/contributing-components.mdx | 69 +- docs/docs/Deployment/deployment-docker.mdx | 4 +- .../_partial-basic-component-structure.mdx | 70 ++ docs/sidebars.js | 2 +- 7 files changed, 477 insertions(+), 488 deletions(-) create mode 100644 docs/docs/_partial-basic-component-structure.mdx diff --git a/docs/docs/Components/components-custom-components.mdx b/docs/docs/Components/components-custom-components.mdx index d58e30547a..c65574e735 100644 --- a/docs/docs/Components/components-custom-components.mdx +++ b/docs/docs/Components/components-custom-components.mdx @@ -6,128 +6,314 @@ slug: /components-custom-components import Icon from "@site/src/components/icon"; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; +import PartialBasicComponentStructure from '../_partial-basic-component-structure.mdx'; -Custom components extend Langflow's functionality through Python classes that inherit from `Component`. This enables integration of new features, data manipulation, external services, and specialized tools. - -In Langflow's node-based environment, each node is a "component" that performs discrete functions. Custom components are Python classes which define: - -* **Inputs** — Data or parameters your component requires. -* **Outputs** — Data your component provides to downstream nodes. -* **Logic** — How you process inputs to produce outputs. - -The benefits of creating custom components include unlimited extensibility, reusability, automatic field generation in the visual editor based on inputs, and type-safe connections between nodes. - -Create custom components for performing specialized tasks, calling APIs, or adding advanced logic. +Create your own custom components to add any functionality you need to Langflow, from API integrations to data processing. +In Langflow's node-based environment, each node is a "component" that performs discrete functions. Custom components in Langflow are built upon: * The Python class that inherits from `Component`. * Class-level attributes that identify and describe the component. -* Input and output lists that determine data flow. -* Internal variables for logging and advanced logic. +* [Input and output lists](#inputs-and-outputs) that determine data flow. +* Methods that define the component's behavior and logic. +* Internal variables for [Error handling and logging](#error-handling-and-logging) -## Class-level attributes +Use the [Custom component quickstart](#quickstart) to add an example component to Langflow, and then use the reference guide that follows for more advanced component customization. -Define these attributes to control a custom component's appearance and behavior: +## Custom component quickstart {#quickstart} -```python -class MyCsvReader(Component): - display_name = "CSV Reader" - description = "Reads CSV files" - icon = "file-text" - name = "CSVReader" - documentation = "http://docs.example.com/csv_reader" +Create a custom `DataFrameProcessor` component by creating a Python file, saving it in the correct folder, including an `__init__.py` file, and loading it into Langflow. + +### Create a Python file + + + +### Save the custom component {#custom-component-path} + +Save the custom component in the Langflow directory where the UI will discover and load it. + +By default, Langflow looks for custom components in the `src/lfx/src/lfx/components` directory. + +When saving components in the default directory, components must be organized in a specific directory structure to be properly loaded and displayed in the visual editor. + +Components must be placed inside category folders, not directly in the base directory. + +The category folder name determines where the component appears in the Langflow