Is there a way to pre-populate dbc.input text boxes?

What property can I use to pre-populate the address field? dcc.Input | Dash for Python Documentation | Plotly. Placeholder doesn’t do it, I need to assign value to the text field, I have both text and numeric fields.

dbc.Input(
                id="address-deal",
                persistence=True,
                persistence_type="memory"
              ),

Hi @keval
Have you tried using the value property?

1 Like

Hi @AnnMarieW

Yes, it doesn’t seem to work for input type=“text” or for dcc.Dropdown as well.

1 Like

Can you try running this example? It seems to be working for me?

import dash
import dash_bootstrap_components as dbc

app = dash.Dash(external_stylesheets=[dbc.themes.BOOTSTRAP])

app.layout = dbc.Container(
    dbc.Input(value="Hello", type="text"), className="p-5"
)

if __name__ == "__main__":
    app.run_server(debug=True)

image

1 Like