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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <html lang="en">

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>[Typeform] Popup embed API example using buttons</title>

  <div class="container">
    <h1>Cupcake ipsum</h1>
    <h2>Click to open a popup-embedded typeform</h2>

    <div class="popup-buttons">
      <button id="bt-left-drawer" class="my-button">Left drawer</button>
      <button id="bt-popup" class="my-button">Popup</button>
      <button id="bt-right-drawer" class="my-button">Right drawer</button>

    <p>Tiramisu danish powder gingerbread sugar plum wafer biscuit marzipan. Danish soufflé oat cake pie liquorice dessert candy croissant. Biscuit candy gummi bears cookie sweet. Marshmallow jujubes wafer tart lollipop liquorice. Toffee candy liquorice macaroon.</p>
  <script src="" type="text/javascript"></script>
  <script type="text/javascript">
    let popup1, popup2, popup3;
    window.addEventListener('DOMContentLoaded', function () {        
        // When instantiating a popup embed, you must provide the URL
        // of your typeform and your desired embed settings. If you don't
        // provide any settings, a default 'popup' embed is instantiated.
        popup1 = window.typeformEmbed.makePopup('', {
          mode: 'drawer_left',          
          hideHeaders: true,
          hideFooter: true
        popup2 = window.typeformEmbed.makePopup('', {
          hideHeaders: true,
          hideFooter: true
        popup3 = window.typeformEmbed.makePopup('', {
          mode: 'drawer_right',
          hideHeaders: true,
          hideFooter: true
      // Now we bind our buttons to open our previously instantiated
      // embedded typeforms when clicked
      document.getElementById('bt-left-drawer').addEventListener('click', function () {;
      document.getElementById('bt-popup').addEventListener('click', function () {;
      document.getElementById('bt-right-drawer').addEventListener('click', function () {;

              body {
  background: url('');
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;  

h1 {
  font-size: 50px;
  text-align: center;

.container {
  margin: 0 auto;
  width: 600px;

.container p, .container h2 {
  text-align: center;

.popup-buttons {
  display: flex;
  justify-content: space-between;
  padding: 20px 0;

.my-button {
  font-size: 18px;
  color: white;
  background-color: steelblue;
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  cursor: pointer;

.my-button:focus {
  outline: 0;

🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.