Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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.


Save Automatically?

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.


                <!DOCTYPE html>
<html lang="en">

  <meta charset="UTF-8">
  <title>My React Project on CodePen</title>
  <script src="" type="text/javascript"></script>

  <div id="root"></div>
  <div id="content">
    <h2>Custom Popup</h2>
    <p>Can be used to render HTML markup.</p>



                body {
  margin: 0;

#map {
  height: 100vh;
  width: 100vw;

/* The popup bubble styling. */
.popup-bubble {
  /* Position the bubble centred-above its parent. */
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -100%);
  /* Style the bubble. */
  background-color: white;
  padding: 10px 10px 20px;
  border-radius: 5px;
  font-family: sans-serif;
  overflow-y: auto;
  max-height: 60px;
  box-shadow: 0px 2px 10px 1px rgba(0, 0, 0, 0.5);
  background: pink;
/* The parent of the bubble. A zero-height div at the top of the tip. */
.popup-bubble-anchor {
  /* Position the div a fixed distance above the tip. */
  position: absolute;
  width: 100%;
  bottom: 8px;
  left: 0;
/* This element draws the tip. */
.popup-bubble-anchor::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  /* Center the tip horizontally. */
  transform: translate(-50%, 0);
  /* The tip is a */
  width: 0;
  height: 0;
  /* The tip is 8px high, and 12px wide. */
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid black;
/* JavaScript will position this div at the bottom of the popup tip. */
.popup-container {
  cursor: auto;
  height: 0;
  position: absolute;
  /* The max width of the info window. */
  width: 200px;



                // This example displays a marker at the center of Australia.
// When the user clicks the marker, an info window opens.

(function() {
   class Map extends React.Component {
      /** DOM container where the map canvas gets rendered. */
      mapContainer = React.createRef();

      componentDidMount() {
         /** Create new google map. */ = new google.maps.Map(this.mapContainer.current, {
            zoom: this.props.zoom,
      render() {
         // reference to the DOM element where the map will be rendered
         return (
               style={{ height: "100vh", width: "100vw" }}

            lat: 37.8145864,
            lng: -122.4784945