How to add linkedin share feature to plotly dash app?

Add the JS script as an external script and insert the IN/Share element anywhere in the app where you would like the share button to appear. Here is an MWE,

import dash
import dash_html_components as html

app = dash.Dash(external_scripts=["https://platform.linkedin.com/in.js"])
app.layout = html.Div([html.Script(**{"data-url": "https://platform.linkedin.com/in.js"}, type="IN/Share")])

if __name__ == '__main__':
    app.run_server()
3 Likes