Custom Component
A custom-built React, or HTML and JavaScript, component.
This is a legacy component that is no longer supported. Use custom component libraries if you want to build custom components for Retool apps.
Custom Component supports passing data to and from the Retool app. It can be granted permission for popups, link redirection, and camera access.
Properties
All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
allowCamera
Whether to allow access to a connected camera.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
allowDownloads
Whether to allow downloads.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
allowForms
Whether to allow form submissions.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
allowFullscreen
Whether to allow fullscreen mode.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
allowGeolocation
Whether to allow access to the user's location.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
allowMicrophone
Whether to allow access to the microphone.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
allowModals
Whether to allow modals.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
allowPayments
Whether to allow payments using PaymentRequest()
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
allowPopups
Whether to allow popups.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
allowPopupsToEscapeSandbox
Whether to allow popups to escape the sandbox.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
allowSameOrigin
Whether to allow content to be treated as being from the same origin.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
allowTopNavigation
Whether to allow navigation away from the app.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
heightType
Whether the height automatically adjusts to fit content or is a fixed size.
Type | string | ||||||
Format | Plain Text | ||||||
Mutability |
| ||||||
Allowed Values |
| ||||||
Default |
|
hidden
Whether this object is hidden from view.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
true
id
The unique identifier (name).
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
query1
button1
isHiddenOnDesktop
Whether to show or hide this object in the desktop layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
isHiddenOnMobile
Whether to show or hide this object in the mobile layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
maintainSpaceWhenHidden
Whether to take up space on the canvas if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
margin
The amount of margin to render outside.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
4px 8px
showInEditor
Whether the component remains visible in the editor if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
style
Custom style options.
Type | object | ||||
Mutability |
|
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
customComponent.reload()
Reload the component.
customComponent.reload()
Examples
Reload customComponent
.
customComponent.reload();
customComponent.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
customComponent.scrollIntoView(options)
Parameters
options
Required
The scroll options.
Object Properties
behavior
Required
The scroll behavior.
Supported Values
auto | Scroll immediately to the specified position. |
smooth | Scroll gradually to the specified position. |
block
Required
The scroll position relative to the component.
Supported Values
nearest | Scrolls only the minimum amount required for the component to appear in the visible area. Scrolling does not occur if the component is already in view. |
start | Scrolls to position the component at the top of the visible area. |
center | Scrolls to position the component in the middle of the visible area. |
end | Scrolls to position the component at the bottom of the visible area. |
Examples
Scroll the minimum amount to immediately bring customComponent
into view.
customComponent.scrollIntoView({behavior: 'auto', block: 'nearest'});
customComponent.updateModel()
Update the model with the specified value.
customComponent.updateModel(model)
Parameters
model
Dynamic data.
Events
Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.
Event | Description |
---|