arcgis-widgets-ui
Skill1 starsChanged 6 months agoMITView on GitHub
Add core UI to a map with the ArcGIS Maps SDK for JavaScript 5.1 using Map Components: arcgis-legend, arcgis-layer-list, arcgis-search, arcgis-basemap-gallery, and arcgis-expand, nested in the map with slot="top-right" (a position attribute is ignored) or bound from outside with reference-element (an unbound or mistyped one renders empty, silently). The equivalent Core widgets are deprecated (4.32 to 5.0). Use this skill whenever the user adds a legend, layer list, search box, or basemap picker to a map.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- GeoDaoyu/arcgis-maps-sdk-js-ai-contexttheir own version, first seen Nov 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- GeoDaoyu/arcgis-maps-sdk-js-ai-context★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository73 other files it gives its agents.
- skills/arcgis-3d-layers/AGENTS.mdAGENTS.md
- skills/arcgis-advanced-layers/AGENTS.mdAGENTS.md
- skills/arcgis-ai-components/AGENTS.mdAGENTS.md
- skills/arcgis-arcade/AGENTS.mdAGENTS.md
- skills/arcgis-authentication/AGENTS.mdAGENTS.md
- skills/arcgis-charts/AGENTS.mdAGENTS.md
- skills/arcgis-cim-symbols/AGENTS.mdAGENTS.md
- skills/arcgis-coding-components/AGENTS.mdAGENTS.md
- skills/arcgis-coordinates-projection/AGENTS.mdAGENTS.md
- skills/arcgis-core-maps/AGENTS.mdAGENTS.md
- skills/arcgis-core-utilities/AGENTS.mdAGENTS.md
- skills/arcgis-custom-rendering/AGENTS.mdAGENTS.md
- skills/arcgis-editing/AGENTS.mdAGENTS.md
- skills/arcgis-embeddable-maps/AGENTS.mdAGENTS.md
- skills/arcgis-feature-effects/AGENTS.mdAGENTS.md
- skills/arcgis-geometry-operations/AGENTS.mdAGENTS.md
- skills/arcgis-imagery/AGENTS.mdAGENTS.md
- skills/arcgis-interaction/AGENTS.mdAGENTS.md
- skills/arcgis-knowledge-graphs/AGENTS.mdAGENTS.md
- skills/arcgis-layers/AGENTS.mdAGENTS.md
- skills/arcgis-map-tools/AGENTS.mdAGENTS.md
- skills/arcgis-parquet/AGENTS.mdAGENTS.md
- skills/arcgis-performance/AGENTS.mdAGENTS.md
- skills/arcgis-popup-templates/AGENTS.mdAGENTS.md
- skills/arcgis-portal-content/AGENTS.mdAGENTS.md
- skills/arcgis-rest-services/AGENTS.mdAGENTS.md
- skills/arcgis-scene-environment/AGENTS.mdAGENTS.md
- skills/arcgis-smart-mapping/AGENTS.mdAGENTS.md
- skills/arcgis-spatial-analysis/AGENTS.mdAGENTS.md
- skills/arcgis-starter-app/AGENTS.mdAGENTS.md
- skills/arcgis-tables-forms/AGENTS.mdAGENTS.md
- skills/arcgis-time-animation/AGENTS.mdAGENTS.md
- skills/arcgis-utility-networks/AGENTS.mdAGENTS.md
- skills/arcgis-visualization/AGENTS.mdAGENTS.md
- skills/arcgis-widgets-advanced/AGENTS.mdAGENTS.md
- skills/arcgis-widgets-ui/AGENTS.mdAGENTS.md
- skills/hello-world/AGENTS.mdAGENTS.md
- arcgis-3d-layersSkill
- arcgis-advanced-layersSkill
- arcgis-ai-componentsSkill
- arcgis-arcadeSkill
- arcgis-authenticationSkill
- arcgis-chartsSkill
- arcgis-cim-symbolsSkill
- arcgis-coding-componentsSkill
- arcgis-coordinates-projectionSkill
- arcgis-core-mapsSkill
- arcgis-core-utilitiesSkill
- arcgis-custom-renderingSkill
- arcgis-editingSkill
- arcgis-embeddable-mapsSkill
- arcgis-feature-effectsSkill
- arcgis-geometry-operationsSkill
- arcgis-imagerySkill
- arcgis-interactionSkill
- arcgis-knowledge-graphsSkill
- arcgis-layersSkill
- arcgis-map-toolsSkill
- arcgis-parquetSkill
- arcgis-performanceSkill
- The first 60 shown.
The file
Files
Widgets & UI
When to use: Activate this skill whenever the user adds a legend, layer list, search box, or basemap gallery. Prefer Map Components — the Core widgets are deprecated (4.32 to 5.0).
Overview
Legends, layer lists, and search are Map Components placed in the map's slots.
- Problem it solves: standard map UI without hand-built panels.
- Who it serves: developers assembling a map app shell.
- Pattern it teaches: nest
<arcgis-*>components in the map with aslot, or bind them from elsewhere withreference-element. - What it does NOT cover: advanced widgets (see
arcgis-widgets-advanced) or editing UI (arcgis-editing).
⚠️ The Core widgets are deprecated: BasemapGallery since 4.32, Search since 4.33, Legend and Expand since 4.34, LayerList since 5.0. Use the components below.
Quick Start
<arcgis-map basemap="osm" center="-74.08,4.6" zoom="11">
<arcgis-search slot="top-right"></arcgis-search>
<arcgis-legend slot="bottom-left"></arcgis-legend>
</arcgis-map>import "@arcgis/map-components/components/arcgis-map";
import "@arcgis/map-components/components/arcgis-search";
import "@arcgis/map-components/components/arcgis-legend";Measured on 5.1.27 without an API key: arcgis-search uses the World Geocoding Service by default, returned 6 results
for "Villa de Leyva" and moved the map there; arcgis-basemap-gallery listed 31 basemaps.
Decision Tree
- New project?
- Yes → Map Components (
<arcgis-legend>,<arcgis-search>, ...).
- Yes → Map Components (
- Maintaining a 4.x app mid-migration?
- Yes → keep the widget temporarily; plan the move before 6.0.
- Which UI?
- Symbology key →
arcgis-legend; toggle layers →arcgis-layer-list; find places →arcgis-search; switch basemap →arcgis-basemap-gallery; collapse any of them →arcgis-expand.
- Symbology key →
- Where does it go?
- Inside the map →
slot="top-right"(or another corner); it binds by itself. - Elsewhere on the page →
reference-element="#mapId"with the map's exact id.
- Inside the map →
Default: components nested in the map with a slot.
Import Patterns
Direct ESM (recommended for npm/Vite/Webpack)
import "@arcgis/map-components/components/arcgis-layer-list";Dynamic Imports (CDN)
await $arcgis.import("@arcgis/map-components/components/arcgis-layer-list");Map Components (recommended for new projects)
import "@arcgis/map-components/components/arcgis-search";Key Concepts
Concept 1: Binding
A component nested in <arcgis-map> finds the view by itself, including inside an arcgis-expand (measured: the
layer list had the 2D view before the expand was opened). Outside the map it needs reference-element. Without a
view the component renders but shows nothing, and no error is raised.
Concept 2: Placement is a slot
Corners are slots: top-left, top-right, bottom-left, bottom-right, and the -start/-end variants. Two
components in the same slot stack: measured, a search and a legend in top-right sat one above the other without
overlapping. There is no position property.
Concept 3: Data binding
A bound <arcgis-legend> follows the map's layers and renderers: measured, adding a FeatureLayer gave it one entry in
activeLayerInfos with no wiring.
Common Pitfalls (Top 3)
Pitfall 1: Using the deprecated widget in a new app
// ❌ Anti-pattern
import Legend from "@arcgis/core/widgets/Legend.js"; // deprecated since 4.34// ✅ Correct
import "@arcgis/map-components/components/arcgis-legend";Impact: building on an API slated for removal in 6.0.
Pitfall 2: A component with no map, or the wrong selector
<!-- ❌ Anti-pattern: outside the map with no binding, or a selector that does not match -->
<arcgis-map id="myMap" basemap="osm"></arcgis-map>
<arcgis-legend reference-element="#map"></arcgis-legend><!-- ✅ Correct -->
<arcgis-map id="myMap" basemap="osm"></arcgis-map>
<arcgis-legend reference-element="#myMap"></arcgis-legend>Impact: measured: unbound and mistyped legends both had view: null and 0 layers, while the nested one had the 2D
view and 1 layer. Neither logged an error.
Pitfall 3: Placing components with position
<!-- ❌ Anti-pattern -->
<arcgis-map basemap="osm"><arcgis-legend position="bottom-left"></arcgis-legend></arcgis-map><!-- ✅ Correct -->
<arcgis-map basemap="osm"><arcgis-legend slot="bottom-left"></arcgis-legend></arcgis-map>Impact: measured in arcgis-widgets-advanced: with position, the component falls into the default slot, a strip
across the top of the map, instead of the corner. No error.
When to Read references/
| If you need... | Read |
| Component attributes/events | references/api-detail.md |
| Placement + binding examples | references/examples.md |
| More pitfalls (5+ extended) | references/pitfalls.md |
Related Skills
arcgis-core-maps— the map components bind toarcgis-widgets-advanced— print, bookmarks, daylight, etc.arcgis-layers— the layers a legend/layer-list shows
Reference Samples
Changelog
- 0.2.0 (2026-10-27): SDK 5.1. Runtime checks in
tests/runtime/casos/arcgis-widgets-ui.ts. Every example placed components withposition, which they do not have (they land in the default slot); nowslot. The binding pitfall is now measured (unbound and mistyped legends:view: null, 0 layers, no error). Removed the false "overlapping positions" pitfall (two components in one slot stack, measured), the comment-only ones (widget-only APIs, styles), and the generic "import every component" one. Measured that search and the basemap gallery work without an API key and that a component insidearcgis-expandbinds by itself. Corrected the deprecation versions (4.32 to 5.0), thedist/componentsimport paths, the CDN import that pointed at the deprecated widget, and anarcgis/topographicbasemap in an example that needs a key. - 0.1.0 (2026-05-31): Initial release.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

