Skip to main content

The Modal frame

A container that appears above other content.

The Modal frame is a container that appears as an overlay in the center of the app when visible. You can add multiple instances of the Modal frame that operate independently.

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.

enableFullBleed

Whether to expand the contents to fill available space.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Expand contents to fit
Default
false
Examples
true

footerPadding

The amount of padding used within the footer.

Type string
Format Plain Text
Mutability
ControlUsage
Retool UI Inspector > Content > Add-ons > Footer > Padding
Allowed Values
ValueUI OptionDescription
8px 12pxNormal

8px top and bottom, 12px left and right.

0None

No padding.

Default
8px 12px
Examples
"8px 12px"

headerPadding

The amount of padding used within the header.

Type string
Format Plain Text
Mutability
ControlUsage
Retool UI Inspector > Content > Add-ons > Header > Padding
Allowed Values
ValueUI OptionDescription
8px 12pxNormal

8px top and bottom, 12px left and right.

0None

No padding.

Default
8px 12px
Examples
"8px 12px"

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Hidden
MethodsetHidden()
Default
false
Examples
true

hideOnEscape

Whether to toggle hidden to true when the Esc key is pressed.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Interaction > Advanced > Hide on escape
Default
true
Examples
true

loading

Whether to display a loading indicator.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Interaction > Loading
Default
false
Examples
true

overlayInteraction

Whether to toggle hidden to true if the user clicks outside of the content area.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Interaction > Close when clicking outside
Default
true
Examples
true

padding

The amount of padding to render inside.

Type string
Format Plain Text
Mutability
ControlUsage
Retool UI Inspector > Spacing > Padding
Allowed Values
ValueDescription
4px 8px

Normal padding.

0

No padding.

Default
4px 8px
Examples
4px 8px

showBorder

Whether to show a border.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Show border
Default
false
Examples
true

showFooter

Whether to show the footer area.

Type boolean
Mutability
ControlUsage
Retool UI Inspector
MethodsetShowFooter()

showFooterBorder

Whether to show a border above the footer.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Content > Add-ons > Footer > Appearance > Show separator
Examples
true

showHeader

Whether to show the header area.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Content > Add-ons > Header > Appearance > Show header
MethodsetShowHeader()
Default
false
Examples
true

showHeaderBorder

Whether to show a border under the header.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Content > Add-ons > Header > Appearance > Show separator
Default
true
Examples
true

showOverlay

Whether to display a darkened overlay when visible.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Show overlay
Examples
true

tooltipText

The tooltip text to display next to the label on hover.

Type string
Format Markdown
Mutability
ControlUsage
Retool UI Inspector > Content > Add-ons > Helper text
Default
null
Examples
Submit

width

The width.

Type string
Format Integer
Mutability
ControlUsage
Retool UI Inspector
Allowed Values
ValueDescription
small

Small.

medium

Medium.

large

Large.

fullScreen

Full screen.

Examples
1280

Methods

JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.

modal.hide()

Hide the component.

Definition
modal.hide()
Examples

Hide modal.

modal.hide();

modal.setHidden()

Set the hidden value to toggle whether the component is visible. Defaults to true without a parameter.

Definition
modal.setHidden(hidden)
Parameters

hidden

boolean

Whether this object is hidden from view.

Examples

Hide modal.

modal.setHidden(true);

Unhide modal.

modal.setHidden(false);

modal.show()

Show the component.

Definition
modal.show()
Examples

Show modal.

modal.show();

modal.showFooter()

Set the showFooter value to toggle whether the component footer is visible.

Definition
modal.showFooter(showFooter)
Parameters

showFooter

boolean

Whether to show the footer area.

Examples

Show the footer of modal.

modal.setShowFooter(true);

Hide the footer of modal.

modal.setShowFooter(false);

modal.showHeader()

Set the showHeader value to toggle whether the component header is visible.

Definition
modal.showHeader(showHeader)
Parameters

showHeader

boolean

Whether to show the header area.

Examples

Show the header of modal.

modal.setShowHeader(true);

Hide the header of modal.

modal.setShowHeader(false);

modal.toggleHidden()

Toggle the hidden value between true and false.

Definition
modal.toggleHidden()
Examples

Toggle the hidden value of modal.

modal.toggleHidden();

Events

Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.

EventDescription