Accordion item title styling #980
-
Beta Was this translation helpful? Give feedback.
Answered by
tcbegley
Apr 25, 2024
Replies: 2 comments
-
Unfortunately I don't believe this is currently possible in Dash because of the way that Here's a possible workaround though using CSS import dash_bootstrap_components as dbc
from dash import Dash
app = Dash(external_stylesheets=[dbc.themes.BOOTSTRAP])
app.layout = dbc.Container(
dbc.Accordion(
[
dbc.AccordionItem(
f"The content of accordion item {i}",
title=f"#{i}",
)
for i in range(1, 4)
]
),
className="p-5",
)
if __name__ == "__main__":
app.run_server(debug=True) and some CSS in .accordion-button::before {
content: 'Collapsible group item';
font-weight: 700;
color: teal;
padding-right: 5px;
} Here's what it looks like for me Hope this helps. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is now possible with the latest version of dash-bootstrap-components
import dash_bootstrap_components as dbc
from dash import Dash, html
app = Dash(external_stylesheets=[dbc.themes.BOOTSTRAP])
app.layout = dbc.Container(
dbc.Accordion(
[
dbc.AccordionItem(
f"The content of accordion item {i}",
title=[
html.Span(
"Collapsible group item",
style={"color": "blue", "fontWeight": 800},
),
html.Span(f"#{i}", className="ms-1"),
],
)
for i in range(1, 4)
]
),
className="p-5",
)
if __name__ == "__main__":
app.run_server(debug=True) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tcbegley
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is now possible with the latest version of dash-bootstrap-components