<div id="map"></div>
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

#map {
  height: 100%;
}
const map = L.map('map').setView([52.2, -1.5], 8);

const cartoDBDarkMatter = L.tileLayer('https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png', {
  attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>',
  subdomains: 'abcd',
  maxZoom: 19
});

cartoDBDarkMatter.addTo(map);

External CSS

  1. https://unpkg.com/leaflet@1.7.1/dist/leaflet.css

External JavaScript

  1. https://unpkg.com/leaflet@1.7.1/dist/leaflet.js