<aside> 👉 Custom code is available for users on the Basic plan and above.
</aside>
The Custom code block is a powerful feature which allows you to insert custom snippet of code, including HTML, CSS and/or Javascript, anywhere in your application. The code snippet will be added inside the <body> html element.
NOTE: If you want to add custom code snippets inside <head> element, or at the end of the page, before the <body> element closes, you can do that from Settings => Custom Code for application level changes or from Page Settings for page level modifications. This tutorial covers the cases when you want to add a code snippet anywhere inside the <body> element.
Custom code is added through the Custom Code block in Blocks => Static => Custom code.
<aside> 💡 You need to be on a paid plan to be able to use the Custom code block.
</aside>
Next, you need to open the block settings and paste the code snippet you would like to add. It can contain standard HTML elements, <style> elements containing custom CSS rules, and even <script> tags containing JavaScript code.
Custom Code block
Now, you can Preview your Softr app to see the changes.
Let's see how the Custom Code block works on a specific example. We'll use it to embed a Calendly widget within our Softr app.
In our Calendly account, we are going to navigate to Share Your Link in the Account dropdown menu.
Share your link
In the pop-up that appears next, let's choose the embed option as shown below.
Selecting "Add to Your Website”
Next, we'll select Inline Embed and hit continue.
Choosing "Inline Embed”
In the following screen, we can customize our Calendly widget, and, when we're done, we need to click Copy Code.