October 20, 2020, 11:09am
I’m quite new to Dash and was wondering if someone has already done this before. I’m trying to embed a Twitter publish widget in my Dash app. Is there a way I can get the following code from HTML to the usual Plotly Dash’s syntax?
<a class="twitter-timeline" data-width="400" data-height="400" href="https://twitter.com/DavidLojkasek?ref_src=twsrc%5Etfw">Tweets by DavidLojkasek</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Any help is appreciated!
You can directly paste the code snippet from Twitter Publish inside the
srcDoc attribute of
Here’s a working example:
from dash import Dash, html
app = Dash()
app.layout = html.Div([
<a class="twitter-timeline" data-theme="light" href="https://twitter.com/elonmusk?ref_src=twsrc%5Etfw">
Tweets by Elon Musk
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
if __name__ == '__main__':
March 28, 2022, 1:33pm
@atharvakatre! This is very helpful!