Callback Decorator in Loop

The workaround is to define possible combination of things upfront, what I explained in Dynamic Controls and Dynamic Output Components. If defining everything upfront isn’t possible, then it’s not possible to build that type of UI is not possible in pure Dash right now. Alternatively, you can build the UI in React and then make it a Dash plugin (Build Your Own Components | Dash for Python Documentation | Plotly). I’d like to add support for dynamic components and callbacks to Dash we’ll likely need a commercial sponsor to help fund that work (it’s a significant amount of work).

Yes, those two things are very different. Dash, like all web apps, works by having a stateless backend and keeping the per-user state is stored in the frontend (the browser). This allows Dash to handle serving multiple users concurrently and to run on multiple processes without having to keep every user’s session in backend memory or keep data synchronized across multiple processes. Callbacks work by asking the front-end (where all the data is stored) to pass the value down to the backend on demand: whenever the input changes. Data isn’t automatically synced up between the backend and frontend (that would be too much data to pass over the network), it’s only passed through callbacks.