Skip to content
Types
import type { BreakpointsOwner } from "@arcgis/core/views/BreakpointsOwner.js";
Subclasses:
View2D, SceneView
Since
ArcGIS Maps SDK for JavaScript 4.0

A mixin that adds breakpoints, heightBreakpoint, orientation and widthBreakpoint properties to View2D and SceneView classes.

Properties

breakpoints

Property
Type
Breakpoints

A convenience property used for defining the breakpoints on the height and width of the view. The sizes specified here determine the values of the widthBreakpoint and heightBreakpoint properties depending on the view's size.

Setting up breakpoints can aid in responsive app design. It does this by watching width and height breakpoints. This is helpful as it removes the need for multiple @media calls. Instead of listening for the view's size and/or resizes property, you can set up a watch handler for either the widthBreakpoint or heightBreakpoint properties of the view.

Please refer to the styling guide for additional information on working with this.

See also
Example
// Instead of watching the size or resizing properties
reactiveUtils.watch(() => view.size, () => {});
reactiveUtils.watch(() => view.resizing, () => {});
// Set up a watch handle for breakpoint
reactiveUtils.watch(
() => view.widthBreakpoint,
(breakpoint) => {
switch (breakpoint) {
case "xsmall":
// do something
break;
case "small":
case "medium":
case "large":
case "xlarge":
// do something else
break;
default:
}
}
);

heightBreakpoint

Property
Type
BreakpointSize

A convenience property indicating the general size of the view's height. This value is determined based on where the view's height falls in the ranges defined in the breakpoints property. See the table below for a list of possible values. Use the breakpoints property to override the default thresholds.

Please refer to the styling guide for additional information on working with this.

Possible ValueDescriptionDefault thresholds (pixels)
xsmallThe height of the view is smaller than the value set in the xsmall breakpoint.< 545
smallThe height of the view is between the values set in the xsmall and small breakpoints.545 - 768
mediumThe height of the view is between the values set in the small and medium breakpoints.769 - 992
largeThe height of the view is between the values set in the medium and large breakpoints.993 - 1200
xlargeThe height of the view is larger than the value set in the large breakpoint.> 1200
See also
Example
reactiveUtils.watch(
() => view.heightBreakpoint === "xsmall",
() => {
// clear the view's default UI components if
// the app is used on a mobile device
view.ui.components = [];
}
);

orientation

readonly Property
Type
BreakpointOrientation

A convenience property indicating the view's orientation. See the table below for a list of possible values.

Please refer to the styling guide for additional information on working with this.

Possible ValueDescription
landscapeThe width of the view is greater than its height.
portraitThe width of the view is equal to or smaller than its height.

widthBreakpoint

Property
Type
BreakpointSize

A convenience property indicating the general size of the view's width. This value is determined based on where the view's width falls in the ranges defined in the breakpoints property. See the table below for a list of possible values. Use the breakpoints property to override the default thresholds.

Please refer to the styling guide for additional information on working with this.

Possible ValueDescriptionDefault thresholds (pixels)
xsmallThe width of the view is smaller than the value set in the xsmall breakpoint.< 545
smallThe width of the view is between the values set in the xsmall and small breakpoints.545 - 768
mediumThe width of the view is between the values set in the small and medium breakpoints.769 - 992
largeThe width of the view is between the values set in the medium and large breakpoints.993 - 1200
xlargeThe width of the view is larger than the value set in the large breakpoint.> 1200
See also
Example
reactiveUtils.when(
() => view.widthBreakpoint === "xsmall",
() => {
// clear the view's default UI components if
// the app is used on a mobile device
view.ui.components = [];
}
);