Can I embed a Typeform "Right Drawer" style popup in my website using my own div button without using all the custom hardcoded stuff in the Typeform embed code?

Published on
September 22, 2023

Yes, you can embed a Typeform "Right Drawer" style popup in your website using your own div button without relying on the custom hardcoded stuff in the Typeform embed code. Here's how you can accomplish this using JavaScript:

  1. First, add the Typeform JavaScript SDK to your website by including the following code in the <head> section of your HTML:
<script src="https://embed.typeform.com/embed.js"></script>
  1. Next, create a button or div element that will trigger the Typeform popup. Give it an appropriate ID, for example:
<button id="typeform-button">Open Typeform</button>
  1. Now, add a script tag at the bottom of your HTML, just before the closing </body> tag, to handle the button click event and open the Typeform popup:
<script>document.getElementById("typeform-button").addEventListener("click", function() {  var tfPopup = Typeform.createPopup({    url: 'Your_Typeform_URL',    mode: 'drawer_right',    autoOpen: true,    hideScrollbars: true  });});</script>

Replace 'Your_Typeform_URL' with the URL of the Typeform you want to display.

  1. Save your changes and test the button on your website. Clicking on it will now open the Typeform "Right Drawer" style popup with the specified URL.

By using this approach, you are able to control the appearance and behavior of the Typeform popup using your own div button, without having to rely on the custom hardcoded stuff in the Typeform embed code.

Note: Make sure to replace 'Your_Typeform_URL' with the actual URL of your Typeform in the script section.


Additional Questions:

  • How do I customize the appearance of the Typeform "Right Drawer" style popup?
  • Can I embed other types of popups in my website using Webflow with my own button?
  • What are some alternatives to Typeform for embedding interactive forms in a website?