Expand

ESM:
Use dark colors for code blocksCopy
1
import "@arcgis/map-components/components/arcgis-expand";
CDN:
No specific import is needed for this component.

The Expand component acts as a clickable button for displaying interactive content, most commonly other components.

Demos

Expand with Custom ContentExpand with Component Content

The Expand component with custom content. The content must be wrapped in a Placement component.

The Expand component with the Basemap Gallery component.

Properties

PropertyAttributeType
auto-collapse
boolean
auto-destroy-disabled
boolean
close-on-esc
Function | boolean
collapse-icon
string
collapse-tooltip
string
expanded
boolean
expand-icon
string
expand-tooltip
string
focus-trap-disabled
boolean
focus-trap-enabled
boolean
group
string
icon-number
number
label
string
mode
"auto" | "drawer" | "floating"
placement
"auto" | "auto-end" | "auto-start" | "bottom" | "bottom-end" | "bottom-start" | "leading" | "leading-end" | "leading-start" | "left" | "left-end" | "left-start" | "right" | "right-end" | "right-start" | "top" | "top-end" | "top-start" | "trailing" | "trailing-end" | "trailing-start"
position
"bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing"
reference-element

autoCollapse

Property
autoCollapse: boolean

Automatically collapses the expand widget instance when the view's viewpoint updates.

Attribute
auto-collapse
Default value
false

autoDestroyDisabled

Property
autoDestroyDisabled: boolean

If true, the component will not be destroyed automatically when it is disconnected from the document. This is useful when you want to move the component to a different place on the page, or temporarily hide it. If this is set, make sure to call the destroy method when you are done to prevent memory leaks.

Attribute
auto-destroy-disabled
Default value
false

closeOnEsc

Property
closeOnEsc: Function | boolean

When true, the Expand widget will close after the Escape key is pressed when the keyboard focus is within its content.

Attribute
close-on-esc
Default value
true

collapseIcon

Property
collapseIcon: string

Calcite icon used to style the Expand button when the content can be collapsed.

Attribute
collapse-icon
Default value
"chevrons-right"

collapseTooltip

Property
collapseTooltip: string

Tooltip to display to indicate Expand widget can be collapsed.

Attribute
collapse-tooltip
Default value
"Collapse" (English locale)

expanded

reflected

Attribute changes are reflected on the DOM.

Property
expanded: boolean

Indicates whether the widget is currently expanded or not.

Attribute
expanded
Default value
false

expandIcon

Property
expandIcon: string

Calcite icon used when the widget is collapsed.

Attribute
expand-icon
Default value
"chevrons-left"

expandTooltip

Property
expandTooltip: string

Tooltip to display to indicate Expand widget can be expanded.

Attribute
expand-tooltip
Default value
"Expand" (English locale)

focusTrapDisabled

Property
focusTrapDisabled: boolean

Disables focus trapping within the expand component.

Attribute
focus-trap-disabled
Default value
false

focusTrapEnabled

deprecatedProperty
focusTrapEnabled: boolean
Deprecatedsince 4.33, use focusTrapDisabled instead.

Disables focus trapping within the expand widget.

Read more...

Attribute
focus-trap-enabled
Default value
false

group

Property
group: string

This value associates two or more Expand widget instances with each other, allowing one instance to auto collapse when another instance in the same group is expanded.

Read more...

Attribute
group

iconNumber

Property
iconNumber: number

A number to display at the corner of the widget to indicate the number of, for example, open issues or unread notices.

Read more...

Attribute
icon-number

label

Property
label: string

The widget's default label.

Read more...

Attribute
label

mode

Property
mode: "auto" | "drawer" | "floating"

The mode in which the widget displays.

Attribute
mode
Default value
"auto"

placement

Property
placement: "auto" | "auto-end" | "auto-start" | "bottom" | "bottom-end" | "bottom-start" | "leading" | "leading-end" | "leading-start" | "left" | "left-end" | "left-start" | "right" | "right-end" | "right-start" | "top" | "top-end" | "top-start" | "trailing" | "trailing-end" | "trailing-start"

The placement used by the calcite popover when the widget is expanded.

Attribute
placement
Default value
null

position

Property
position: "bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing"
Attribute
position
Default value
"top-right"

referenceElement

Property

By assigning the id attribute of the Map or Scene component to this property, you can position a child component anywhere in the DOM while still maintaining a connection to the Map or Scene.

See also
Attribute
reference-element

Slots

No slots to display.

Events

EventType

arcgisReady

Event
arcgisReady: CustomEvent<void>

Emitted when the component associated with a map or scene view is is ready to be interacted with.

bubbles

Events triggered on this element will be propagated to their outermost elements.

composed

The event is composable and will propagate across the shadow DOM into the standard DOM.

cancelable

The event's default behavior can be canceled, allowing for custom behavior to be implemented instead.

Methods

MethodSignature
collapse(): Promise<void>
componentOnReady(): Promise<void>
destroy(): Promise<void>
expand(): Promise<void>
toggle(): Promise<void>

collapse

Method
collapse(): Promise<void>
Returns
Promise<void>

componentOnReady

Method
componentOnReady(): Promise<void>

Create a promise that resolves once component is fully loaded.

Example
Use dark colors for code blocksCopy
1
2
3
4
const arcgisExpand = document.querySelector("arcgis-expand");
document.body.append(arcgisExpand);
await arcgisExpand.componentOnReady();
console.log("arcgis-expand is ready to go!");
Returns
Promise<void>

destroy

Method
destroy(): Promise<void>

Permanently destroy the component.

Returns
Promise<void>

expand

Method
expand(): Promise<void>
Returns
Promise<void>

toggle

Method
toggle(): Promise<void>
Returns
Promise<void>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.