Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
  <title>Popups with Handlebars.js templating</title>
  <link rel="stylesheet" href="">
  <link rel="stylesheet" href="">
  <link rel="stylesheet" href="">

  <div id="viewDiv"></div>
  <!-- write a Handlebars template. This example uses Bootstrap but any HTML will work -->
  <script id="popup-template" type="text/x-handlebars-template">
    <div class="card mb-4 shadow-sm">
      <div class="card-header">
        <h1 class="my-0">The county of {name}...</h1>
      <div class="card-body">
        <h2 class="card-title">... is located in the state of {state_name}</h2>
        <ul class="list-unstyled mt-3 mb-4">
          <li>In the year 2000, the population was {pop2000}</li>
          <li>{name} has a population density of {pop00_sqmi}/sq mile</li>
  <script src=""></script>
  <script src=""></script>



#viewDiv {
  padding: 0;
  margin: 0;
  height: 100%;
  width: 100%;

.esri-popup__content {
  overflow: hidden !important;


], function(
  Map, MapView, FeatureLayer,
) {
  var map = new Map({
    basemap: 'gray'

  var view = new MapView({
    map: map,
    container: "viewDiv",
    center: [-118,34],
    zoom: 7,
    popup: {
      dockEnabled: false,
      dockOptions: {
        buttonEnabled: false,
        breakpoint: false,
  var source = document.getElementById("popup-template").innerHTML;
  var template = Handlebars.compile(source);
  var layerOptions = {
    opacity: 0.5,
    popupTemplate: {
      title: null,
      content: template(),
      overwriteActions: true
  var layerURL = "";
  var countiesLayer = new FeatureLayer(layerURL, layerOptions);