Custom Retool Components Development

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1215
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    852
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1043
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    823
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    815

Developing Custom Retool Components

Retool covers most internal tool tasks with built-in widgets. However, sooner or later there is a requirement that no ready-made component exists for: specific data visualization, an interactive map with custom markers, complex drag-and-drop with business logic. For this, Retool provides a Custom Components mechanism — iframe-isolated React applications embedded in the interface via postMessage API.

How the Custom Components Mechanism Works

A custom component in Retool is a full-fledged React application that lives in an isolated iframe. Interaction with the host is built through Retool.useStateValue and Retool.useEventCallback. Data is passed from Retool to the component via model, the component sends events back via triggerQuery or arbitrary event callbacks.

The development environment is a local server (Vite or CRA), the code is deployed to any static hosting or loaded directly into Retool.

Component Structure

// src/index.tsx — entry point of custom component
import { Retool } from '@tryretool/custom-component-support';

interface ModelData {
  items: Array<{ id: string; label: string; value: number; color: string }>;
  selectedId: string | null;
}

export const BubbleChart: FC = () => {
  const [items] = Retool.useStateValue<ModelData['items']>({
    name: 'items',
    initialValue: [],
    label: 'Chart items',
    inspector: 'array',
  });

  const [selectedId, setSelectedId] = Retool.useStateValue<string | null>({
    name: 'selectedId',
    initialValue: null,
    label: 'Selected item ID',
    inspector: 'string',
  });

  const onSelect = Retool.useEventCallback({ name: 'onItemSelect' });

  const handleBubbleClick = (id: string) => {
    setSelectedId(id);
    onSelect({ id });
  };

  return (
    <BubbleChartRenderer
      items={items}
      selectedId={selectedId}
      onSelect={handleBubbleClick}
    />
  );
};

The @tryretool/custom-component-support package is a mandatory dependency. It abstracts postMessage and provides React hooks for state synchronization.

Building and Deployment

The component is built into a single bundle and deployed to static hosting. Retool supports two connection methods: via URL (CDN/S3/Vercel) and via Retool Toolbox for self-hosted instances.

// vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
  plugins: [react()],
  build: {
    lib: {
      entry: 'src/index.tsx',
      name: 'RetoolCustomComponent',
      fileName: 'index',
      formats: ['umd'],
    },
    rollupOptions: {
      external: ['react', 'react-dom'],
      output: {
        globals: {
          react: 'React',
          'react-dom': 'ReactDOM',
        },
      },
    },
  },
});

After vite builddist/index.umd.js is uploaded to CDN or Retool Cloud Storage. In the Retool interface, a Custom Component is created, the bundle URL is specified, and the iframe-URL of the page is set.

Passing Complex Data

Retool limits the data model to serializable types. For complex structures (nested objects, files), JSON serialization is used within a string field:

const [rawConfig] = Retool.useStateValue<string>({
  name: 'config',
  initialValue: '{}',
  label: 'JSON Config',
  inspector: 'text',
});

const config = useMemo(() => {
  try {
    return JSON.parse(rawConfig);
  } catch {
    return {};
  }
}, [rawConfig]);

For large datasets (thousands of rows), data is passed through a Retool Query, which returns JSON — the component receives it directly without duplicating state in the model.

Typical Tasks for Custom Components

Visualizations: D3.js charts (chord diagram, force-directed graph, sankey), ECharts with custom series, Three.js 3D model previews.

Interactive tables: virtualized lists via @tanstack/virtual for 50k+ rows, inline editing with custom validators, drag-and-drop sorting via @dnd-kit/core.

Maps: Mapbox GL JS / Leaflet with dynamic clusters, drawing tools for geozones, isochrones via Mapbox Isochrone API.

Specific UI patterns: Kanban board with business constraints, Gantt timeline, code editor based on Monaco.

What Happens During Development

Days 1–2: project setup (Vite + React + TypeScript + Retool SDK), agreement on data contract — which fields in the model, which events to output. Minimal working component with mock data.

Days 3–4: implementation of logic and rendering. In parallel — testing integration with real Retool environment (cloud or self-hosted — it matters, SDK versions differ).

Day 5: handling edge cases, data loading, styling according to client's design system, deployment to CDN, delivery of component with documentation.

A component of medium complexity (custom chart or interactive map without complex logic) — 3–5 days. Kanban or Gantt with drag-and-drop and persistence — 1–2 weeks.