Use this as the starting point for building your own custom component library for Retool.
Retool allows you to extend its built-in components by creating your own using React and TypeScript. A custom component library:
- Is developed locally and deployed into Retool using the Retool CLI
- Appears in Retool like any native component
- Can contain multiple reusable components
- Supports nearly any npm package compatible with browsers
This repo provides the project structure, tooling, and example components to help you get started.
- Node.js v20 or later
- Admin permissions in Retool
- A Retool API access token with read and write scopes for Custom Component Libraries
If you are running self-hosted Retool, setting the
ALLOW_SAME_ORIGINandSANDBOX_DOMAINenvironment variables is recommended.
git clone https://github.com/tryretool/custom-component-collection-template your-component-name
cd your-component-nameOr click Use this template at the top of this page to create your own copy.
npm installnpx retool-ccl loginYou will be prompted for your Retool instance URL and an API token. Generate a token in Retool under Settings > API tokens with read and write access for Custom Component Libraries.
npx retool-ccl initThis prompts for a library name and description, writes metadata to package.json, and registers your library with your Retool instance.
Rename the HelloWorld component in src/components/ or create a new folder for your component:
src/
components/
YourComponent/
YourComponent.tsx
YourComponent.test.tsx
README.md
index.tsx
All components exported from src/index.tsx are synced to Retool.
npx retool-ccl devThis syncs your changes to Retool every time you save a file. Open any Retool app to test your component in real time.
- Open your Retool app
- Click Add components
- Find your components under your library's label
- Drag onto the canvas
You may need to refresh Retool for newly added components to appear.
- One component per folder inside
src/components/ - Always export from
src/index.tsx - Prefer explicit props over implicit state
- Avoid hardcoded styles — use CSS modules or props-driven styling
- Include tests for each component
- Document usage in a
README.mdinside each component folder
npm testWhen your component is ready:
npx retool-ccl deployThis pushes an immutable version of your library to Retool. To use your library in public Retool apps, go to Settings > Custom Component Libraries and enable public access.
To pin an app to a specific deployed version:
- Open Custom Component settings in your app
- Select the version you want
- Refresh if necessary
- Custom component libraries are not supported in Retool Mobile or PDF exports
- Library descriptions cannot be edited after creation
- Individual revisions cannot exceed 10MB (30MB in dev mode)
- Only JavaScript and CSS files are loaded at runtime — other file types in the bundle are ignored
- Organizations have a 5GB total storage limit across all libraries
Built something useful? Share it with the Retool community by submitting it to the Custom Component Gallery.
The process has two steps — both are required:
Add your component to the custom-component-gallery repository. See CONTRIBUTING.md for the required folder structure and file format.
Go to retoolcustomcomponents.netlify.app and click Submit Component. This is where you provide your cover image, description, and tags that appear on your gallery card.
Your component will not be reviewed until both steps are complete. Once submitted, our team reviews it and you will receive an email with the decision.