How to do i dynamical html.Div id?

app = Dash(__name__, suppress_callback_exceptions=True)

server = app.server

app.layout = html.Div([
    dcc.Location(id='url', refresh=False),
    html.Div(id={}).format('page-content'+ uuid.uuid4().hex),
    html.Div(id={}).format('page-graph'+uuid.uuid4().hex),
    # uuid.uuid4().hex,
    # html.Div(id='page-content'),
    # html.Div(id='page-graph')
], style={'width': '100%', 'height': '486px'}) #486px

@app.callback(
    Output('page-content'+ uuid.uuid4().hex', 'children'),
    Input('url', 'search')
)

This is my some code
I want to variable html.Div(id) when i receive URL

I Try this But Output to Id is not same

What can i do??

Hello @limaa,

You want to create a new div with some function?

Or are you trying to output that function to the children?

Hi @limaa,

FYI

Actually, Dash has already done this for you.

Also, in your code, if you want to reproduce the same uuid, you need to give it a seed.

1 Like

Sry im late reply
When i receive multiple url in sametime
Want to diffrenet each other html.Div(id)
So I think with uuid make id
But cant’ that

trying to output that function that mean
html.div(id=asdf, children = html.Div(id=

This style?

If you are trying to create unique id’s across the app, but have similar functionality, you should look into pattern-matching:

1 Like

Thank you!!! i ll try this