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.


                <div style="display:none">
  <div id="editor"></div>

<h1 class="h5 mb-3">Flmngr file manager: select image with preview</h1>

<div id="btn" class="btn btn-primary" style="opacity:0.2;cursor:default">Select image...</div>
<div id="loading" style="font-size:12px">Loading file manager...</div>

<h2 class="h5 mt-5">Selected image</h2>
<div id="images">
  No image selected yet.

<script src=""></script>
<script src=""></script>


                body {
  padding: 20px;
  background-color: #F4F4F4;

#images {
  p {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: #444;


                window.onFlmngrAndImgPenLoaded = function() {
  var elBtn = document.getElementById("btn");
  // Style button as ready to be pressed = 1; = "pointer";
  var elLoading = document.getElementById("loading");
  // Add a listener for selecting files
  elBtn.addEventListener("click", function() {

function selectFiles() {
  let flmngr = window.flmngr.create({
    urlFileManager: '',
    urlFiles: '',
    imageFormats: [
        id: "preview",
        title: "Preview",
        suffix: "-preview",
        maxWidth: 250,
        maxHeight: 250
    imageFormats: ["preview"],
    acceptExtensions: ["png", "jpeg", "jpg", "webp", "gif"],
    isMultiple: false,
    onFinish: function(files) {

function showSelectedImageWithPreview(files) {
  var elImages = document.getElementById("images");
  elImages.innerHTML = "";
  // As far we requested just one file, it is the only item of the array
  var file = files[0];
  // Add preview image
  var elTextPreview = document.createElement("p");
  elTextPreview.textContent = "Preview image";
  var elImgPreview = document.createElement("img");
  elImgPreview.src = file.formats.find(function(file) { return file.format === "preview";}).url;
  elImgPreview.alt = "Image preview selected in Flmngr";
  // Add image original
  var elText = document.createElement("p");
  elText.textContent = "Original image";
  let elImg = document.createElement("img");
  elImg.src = file.url;
  elImg.alt = "Image selected in Flmngr";