Skip to main content

Drawer

Ant Design

The Drawer component is a panel that slides in from the edge of the screen and holds its own components. Use it for details or a form that opens beside the page, such as editing a selected record.

Properties​

Property
Description
Expected Value
Trigger textText of the button that opens the drawer.Text. Default: Open
Show triggerShows the button that opens the drawer. Turn it off to open the drawer only with the Show action.On or off. Default: On
TitleHeading at the top of the drawer.Text. Default: Drawer title
ExtraText shown at the right of the drawer's header.Text
PlacementWhich edge of the screen the drawer slides in from.right, left, top, bottom. Default: right
SizeWidth of the drawer, or its height when it opens from the top or bottom. default is 378 pixels and large is 736 pixels.default, large. Default: default
Width (px)A width in pixels, or a height when the drawer opens from the top or bottom. It overrides Size; leave it at 0 to use Size.Number. Default: 0
ClosableShows a close button in the drawer's header.On or off. Default: On
Mask closableCloses the drawer when the user clicks the shaded area outside it.On or off. Default: On

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On closeTriggers when the user closes the drawer, by its close button, the shaded area or the Esc key.
After openTriggers when the drawer has finished opening.
After closeTriggers when the drawer has finished closing.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
ShowOpens the drawer.components.drawer1.show()
HideCloses the drawer.components.drawer1.hide()
Set visibilityShows the component when true, hides it when false.components.drawer1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.drawer1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.drawer1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
triggerTextText of the button that opens the drawer.{{components.drawer1.triggerText}}
showTriggerShows the button that opens the drawer. Turn it off to open the drawer only with the Show action.{{components.drawer1.showTrigger}}
titleHeading at the top of the drawer.{{components.drawer1.title}}
extraText shown at the right of the drawer's header.{{components.drawer1.extra}}
placementWhich edge of the screen the drawer slides in from.{{components.drawer1.placement}}
sizeWidth of the drawer, or its height when it opens from the top or bottom. default is 378 pixels and large is 736 pixels.{{components.drawer1.size}}
widthA width in pixels, or a height when the drawer opens from the top or bottom. It overrides Size; leave it at 0 to use Size.{{components.drawer1.width}}
closableShows a close button in the drawer's header.{{components.drawer1.closable}}
maskClosableCloses the drawer when the user clicks the shaded area outside it.{{components.drawer1.maskClosable}}
opentrue while the drawer is open.{{components.drawer1.open}}
isVisibleWhether the component is visible.{{components.drawer1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.drawer1.isLoading}}
isDisabledWhether the component is disabled.{{components.drawer1.isDisabled}}

Styles​

Style
Default
Primary colorTheme: Brand primary
Text colorTheme: Primary text
Container backgroundTheme: Surface 1
Border colorTheme: Default border
Border radius—
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.