How to embed a Shiny app into your blog posts

This is a one-minute blog post to share how to incorporate Shiny apps in blog posts.

Albert Rapp


May 9, 2022

Today’s a short blog post. It’s mainly for sharing a cool trick I just learned.

Here’s a simple template to incorporate your Shiny app into an HTML file. For instance, you can incorporate your shiny app into your blog post like I do here. Simply exchange the src argument by your Shiny app’s URL and then you’re good to go. Here, I use the app that I have shown you a couple of months ago.

<iframe src="" data-external="1" width="925px" height="800px">

From what I could tell, this is same code that knitr::include_app() drops. But including the iframe manually let’s you adjust the width and height of your frame. Beware that you will have to choose the dimensions large enough for your Shiny app.

UPDATE: Originally, I had demonstrated the above code chunk here. But that causes unnecessary traffic on my account, so I removed the demo.

Stay in touch

If you enjoyed this post, then you may also like my weekly 3-minute newsletter. Every week, I share insights on data visualization, statistics and Shiny web app development. Reading time: 3 minutes or less. Subscribe at

You can also support my work with a coffee