dash-bootstrap-components
dash-bootstrap-components copied to clipboard
HTML in DropdownMenu label
DropdownMenu.label is a string prop, and so prevents putting any HTML in the dropdown toggle. If label could accept a node array we'd be able to put things such as icons in the dropdown toggle, e.g.
dbc.DropdownMenu(
children=[
dbc.DropdownMenuItem("Item 1", href="#"),
dbc.DropdownMenuItem("Item 2", href="#"),
],
label=[
html.I(className="fa-solid fa-house"),
"Home",
],
)