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.


                <div class="outer-body">
  <!--   Draggable h1 for test 🧐  -->
  <h1 draggable="true">Simple Drag and Drop 📦 </h1>

  <!--   Drop Area 📥 -->
  <div class="the-box" id="magicBox" ondrop="onDrop(event)" ondragover="dragging(event)" ondragleave="dragLeft()">


  <span> Made by <a href=""> @Sarthology</a> 👨🏻‍💻</span>
  <span>Powered by <a href=""> XenoX</a> 🔥</span>


span {
  font-family: sans-serif;
  font-weight: 100;
  text-align: center;
a {
  text-decoration: none;
  color: grey;
  font-style: italic;
a:hover {
  text-decoration: underline;
span {
  margin-top: 10px;
.the-box {
  width: 400px;
  height: 250px;
  border: 2px solid #c6c6c6;
  border-style: dashed;
  transition: border-color 1s;
  display: grid;
  justify-content: center;
.the-box img {
  height: 100%;

.outer-body {
  display: grid;
  justify-content: center;
  margin-top: 100px;



                const magicBox = document.getElementById("magicBox");

// Change color of the box if something being dragged 🖍
const dragging = (e) => {
  e.preventDefault(); = "border-color: rgba(164, 37, 228)";

// Back to initial stage when dragging ends 🏃🏾‍♂️
const dragLeft = () => { = "border-color: #c6c6c6";

// Handle File drop on Drop Zone 📥
const onDrop = (e) => {
  e.preventDefault(); = "border-color: #c6c6c6";
  const { files } = e.dataTransfer;

// Appending Image to the Drop area 👩‍👦
const previewImage = (file) => {
  const img = document.createElement("img");
  img.src = URL.createObjectURL(file);

// Create payload and upload to server 🚀
const upload = (files) => {
  const payload = { image: files };
  // Upload to your API 📤