For multipage apps, I typically structure my projects in a similar way to the first project layout described in the section Structuring a Multi-Page App of the Dash Docs. This means just having a simple layout
attribute in each page module containing that pages layout, and having the router register each of them.
You can see this in my Slapdash project.
The two main drawbacks of this approach, which I consider to be friction points for development of more complex Dash apps are:
- No builtin name-spacing of pages, so you have to make sure you don’t duplicate component IDs across your pages, which become a bit of a headache very quickly. See this issue and this community discussion.
- If you use the workaround described in the URLs page of the Dash docs to enable callback validation for multi-page apps, you won’t be able to organise your code into different page modules containing callbacks and layouts for each page due to Dash’s eager callback validation, as described in this issue.