Skip to main content

Use Custom Components in the App Builder

IconPaid feature
BETA

Custom Component Libraries are currently in beta and not recommended for production use.

Once a library is published to your workspace, its components are available to every app builder in that workspace.

Find Custom Components​

Click the library picker at the top of the components panel and choose a library under Custom libraries. The panel then shows the library's Version and a tile for every component, with an icon or the component's initials and its display name. See Choose a Component Library.

A library is listed once it has a published version or a dev upload.

Add and Configure a Component​

Drag a tile onto the canvas. A custom component works like any built-in component. It can be resized, moved, renamed and bound to queries. The component is named after the component itself (for example, currencyinput1), and it is dropped at the default size the author set with useComponentSettings.

The component properties panel opens with a line that names the library and the component, and a Revision row. Below them are these sections:

Section
Contents
PropertiesOne field for each property the author declared, pre-filled with its initial value. Properties grouped with the section option appear in a section of their own.
EventsOne entry for each event the author declared. Attach event handlers the same way as on a built-in component.
ValidationShown for field components only.
Additional ActionsVisibility and Loading state, plus Disable and Dynamic height on components that support them.
DevicesShow on desktop and Show on mobile.

The Styles tab lists the style fields the author declared, then Box shadow.

Exposed Variables​

Every property is also an exposed variable that you can read anywhere in the app, for example {{components.myWidget.firstName}}. Values update live as the component changes them.

Component Actions​

Actions declared by the author appear wherever you choose component actions. For example, in a query's Query Success event, select Control component → your component → the action.

Versions and Pinning​

Each app pins one version of each library. The pinned version is saved with the app version, so it carries over when you release, clone, export or import the app.

  • The first time a component from a library is dropped into an app, the app pins the version the panel shows. That is the latest version, unless another version was selected.
  • To change the version, pick the library in the library picker, open its Version picker and choose a version.
  • Changing the version updates every component from that library in the app at once. It only happens when you choose a version. Publishing a new version never changes a running app.
  • Previewed and released apps always render the pinned version.

Default Properties​

In addition to what the author declares, ToolJet adds the same set of properties, variables and actions to every custom component. Authors don't declare these and can't remove them.

Properties​

Property
Type
Default
Where It Appears
VisibilityToggletrueAdditional Actions
Loading stateTogglefalseAdditional Actions

Components that support them also get Disable and Dynamic height in the same section.

Devices​

Property
Type
Default
Show on desktopToggletrue
Show on mobileTogglefalse

Styles​

Style
Type
Default
Box shadowBox shadow0px 0px 0px 0px #00000040

Exposed Variables​

Variable
Type
Initial Value
How To Access
isVisibleBooleantrue{{components.myWidget.isVisible}}
isLoadingBooleanfalse{{components.myWidget.isLoading}}

Every component also exposes isDisabled.

Component Specific Actions (CSA)​

Action
Parameter
Set visibilityValue: Toggle, defaults to {{false}}.
Set loadingValue: Toggle, defaults to {{false}}.

Every component also has a Set disable action.

These appear in the same action list as the author's own actions. For example, a query can show a loading spinner on a custom component without the author writing any code for it. The spinner covers the component, which stays in place underneath.

info

If a component's code can't be loaded, ToolJet tries again on its own. If it still can't load, the canvas shows "This component couldn't load." in its place, with a Retry button. The app still opens, and everything else keeps working.