Appear html.Button when another one is clicked


I’m quite new in Dash and I have a dropdown that is triggered with a button and I also added a “select-all” button. Though I need the select button to stay hidden and only appear when I click the first one to use the dropdown.

This is the main dropdown button:

def dropdown_button(filter_id):
    return html.Button(
        html.I(className='fa fa-eye'),
        **{'data-toggle': 'collapse', 'data-target': f'#{filter_id}'},

and this is an attempt to make the select button work as intended

html.Button("Select All", id="select-all", n_clicks=0, style=dict(display='none'))

def show_button(dropdown_button):
    if condition:
        return dict()
        return dict(display='none')

Also not sure what to include in the callback.

Thanks in advance for any responses.

Hi @Emanon

I’m not understand what is the id name of your dropdown_button, but you need to include this ‘id’ as an Input of the callback with the property ‘n_clicks’, this property will start in cero and increment by one everytime the uses clicks the button, take in mind that to set your callback function.
An the Output is the id “select-all” with the property “style”.
Also I never worked with style=dict(), instead I use style={‘display’: ‘none’} or style={‘display’: ‘inline-block’}

@app.callback(Output("your-button-id", "n_clicks"),
              Input("select-all", "style"),