Dash Dropdown like R Shiny's pickerInput

Why is there no functionality yet in dash to achieve dropdowns like RShiny pickerInput? The “Select All” and “Deselect All” appear as buttons inside the dropdown. This saves up a lot of space, especially when you have a lot of dropdowns. Using python dash, I need to create dropdowns with buttons below them which take up space.

R SHINY:
image

PYTHON DASH:
image

1 Like

I think the AntdTreeSelect component of my components library fac ( https://fac.feffery.tech/AntdTreeSelect ) may suits your needs well:

demo

import dash
from dash import html
import feffery_antd_components as fac

app = dash.Dash(__name__)

app.layout = html.Div(
    [
        fac.AntdTreeSelect(
            treeData=[
                {
                    'key': 'root',
                    'value': 'root',
                    'title': 'select all',
                    'children': [
                        {
                            'key': f'item-{i}',
                            'value': f'item-{i}',
                            'title': f'item-{i}',
                        }
                        for i in range(1, 6)
                    ]
                }
            ],
            placeholder='please select',
            treeCheckable=True,
            treeDefaultExpandAll=True,
            maxTagCount='responsive',
            style={
                'width': 250
            }
        )
    ],
    style={
        'padding': 100
    }
)


if __name__ == '__main__':
    app.run(debug=True)

3 Likes