✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

Adding Local html file link to dash app and Dash Bootstrap components

How do we reference a local HTML file in a dash app using Dash bootstrap Components?. I am able to add published websites but not local files.

Thanks for your time.

se = dbc.Row(
[
dbc.Col(dbc.NavLink(“C”, active=True, href=“file:///C:/Users/username/Report.html”, style={‘color’: ‘white’})),
],
no_gutters=True,
className=“ml-auto flex-nowrap mt-3 mt-md-0”,
align=“center”,
)

I’m having the same problem. I would like to link (preferably with a different tab or window) to a local pdf HELP/instructions page. Any ideas?

I figured out how to add local html files, but I am not sure about PDFs. Try it and see if it works.

  1. Create a project folder and put your app.py file inside it.
  2. Inside the project folder, you have to create another folder called assets and put your pdf file inside it.
  3. Then, reference the file like this: href="/assets/report.pdf"

Hi. I am also trying to open a local html link on a separate tab in my Dash app. When I click the link it just returns the apps main page. Do you know what might be the issue?

Can you share some of your code? A bit hard to say what the issue might be without more details