Spaces:
Running
Running
Create side_bar.py
Browse files- pages/side_bar.py +22 -0
pages/side_bar.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import dash
|
2 |
+
from dash import html
|
3 |
+
import dash_bootstrap_components as dbc
|
4 |
+
|
5 |
+
|
6 |
+
def sidebar():
|
7 |
+
return html.Div(
|
8 |
+
dbc.Nav(
|
9 |
+
[
|
10 |
+
dbc.NavLink(
|
11 |
+
html.Div(page["name"], className="ms-2"),
|
12 |
+
href=page["path"],
|
13 |
+
active="exact",
|
14 |
+
)
|
15 |
+
for page in dash.page_registry.values()
|
16 |
+
if page["path"].startswith("/topic")
|
17 |
+
],
|
18 |
+
vertical=True,
|
19 |
+
pills=True,
|
20 |
+
className="bg-light",
|
21 |
+
)
|
22 |
+
)
|