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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

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


                <div class="outer">

  <div class="inner">
    <div id="container1" class="container">



                * {
  box-sizing: border-box;

body {
  margin: 0;

div {
  display: inline-block;

.outer {
  background-color: dimgray;
  width: 100vw;
  height: 100vh;

.inner {
  width: 100%;
  height: 100%;
  padding: 1%;

.container {
  width: 100%;
  height: 100%;
  border-radius: 1em;
  overflow: hidden;


                const md = molDraw;

// First create the atoms of the molecule.
const atoms = [
    md.atom ( md.c  ) ( md.position(-0.06)(-0.17)(0)     ),
    md.atom ( ) ( md.position(-1.35)(1.04)(-0.04)  ),
    // Note that indium has a little underscore to avoid conflicts
    // with the "in" keyword.
    md.atom ( md.in_) ( md.position(1.65)(0.73)(-0.06)   ),
    md.atom ( md.h  ) ( md.position(-0.15)(-0.88)(-0.87) ),
    md.atom ( md.h  ) ( md.position(-0.09)(-0.72)(0.97)  )

// Then the bonds.
const bonds = [
    // The arguments are:
    // The id is equal to the index of the atom.,,,

// Then you can try to make the molecule itself.
const eg3 = md.maybeMolecule(atoms)(bonds);

// If creating the molecule fails - md.isLeft(eg3) will return True.
// You can then handle the error gracefully.
if (md.isLeft(eg3))
    console.log('There was an issue with your molecule.');
    // You can call md.fromLeft()(eg3) to get the error message.
    // If creation of the molecule was successful, you can extract
    // the molecule with md.fromRight()(eg3).
    const molecule = md.fromRight()(eg3);
    const scene = md.scene({ containerId: 'container1' });
    const meshes = md.meshes({})(molecule);