How to easily split screen into multiple sections #2693
-
QuestionHi, is there an easy way in nicegui to split the screen into multiple separate scrollable areas (like plain-old HTML frames), where scrolling using also keys works (PgDn, PgUp..) and have variable height/width (e.g. use first top 100px for one area and the rest of the screen for another). Background: I am trying to achieve SPA with view, where you have:
So far I was able to do that with kind of combination of quite many elements (tabs + panels, scroll-areas, rows and columns...), so it seems that I am not doing it the right way. Is there some better or easy way to achieve this? I was not able to find any good example how to do that. Thanks for any advice |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hi @steweg, I think it would help us and the community if you could show a minimal code example of what you already tried. And what exactly does not work? Have you looked into https://nicegui.io/documentation/section_pages_routing#page_layout? |
Beta Was this translation helpful? Give feedback.
-
Need to reopen this. I have tried to recreate the page using def _render(self):
with ui.header(elevated = True):
self._ui_tabs = ui.tabs().classes('w-full')
self._ui_tabs.props('outside-arrows align="left" inline-label')
self._ui_tabs.style('flex: 0 1 auto')
self._ui_tab_panels = ui.tab_panels(self._ui_tabs, animated = False).classes('w-full')
self._ui_tab_panels.style('flex: 1 1 auto') This works nicely for the initial page. But once I add and open tab_panel, which is bigger then the screen, the scrollbar of page is not adjusted automatically and I cannot really scroll down and access the whole content of given tab. Just short recap:
I have tested in:
Any suggestion how to get to stage where there will be just one scroll-bar for whole page? |
Beta Was this translation helpful? Give feedback.
-
After trying to manually create minimum testing code from scratch, it works correctly. I have found out, that it was actually a problem of using of the following line within my application: Once removed it works as it should |
Beta Was this translation helpful? Give feedback.
Hi @steweg,
I think it would help us and the community if you could show a minimal code example of what you already tried. And what exactly does not work? Have you looked into https://nicegui.io/documentation/section_pages_routing#page_layout?