Responsive widgets

This sample shows how to use the widthBreakpoint and heightBreakpoint properties on the SceneView to responsively control the visibility of the view's default widgets.

Resize the window to see the default widgets disappear and reappear in the view.

You can control widget visibility in the view's UI components by watching either the widthBreakpoint or heightBreakpoint properties of the view.

1
2
3
4
5
6
7
8
9
10
reactiveUtils.watch(() => [view.heightBreakpoint, view.widthBreakpoint],
([heightBreakpoint, widthBreakpoint]) => {
  const ui = view.ui;

  if (heightBreakpoint === "xsmall" || widthBreakpoint === "xsmall") {
    ui.components = ["attribution"];
  } else {
    ui.components = ["attribution", "navigation-toggle", "compass", "zoom"];
  }
});

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

The developer dashboard has moved

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close