Best Practices for combing static site with Anvil App?

Good news for <iframe> users! I’ve just released a beta of a tool we’ve been using internally, to make embedding Anvil apps much easier by automatically adjusting the height of the iframe.

All you need to do is include https://anvil.works/embed.js in your page, and then include the data-anvil-embed attribute in your <iframe> tag. Here’s an example:

<script src="https://anvil.works/embed.js" async></script>
<iframe src="https://impartial-unaware-pleasure.anvil.app"
        style="width:100%"
        data-anvil-embed></iframe>

Now, the iframe will automatically resize to match your app - even when it pops up alerts such as login windows.

Please give it a try and send us feedback; if it works well we’ll release it officially in the next couple of weeks.

5 Likes