Skip to content

How can I add new content to the scroll_area? #4293

Closed Answered by falkoschindler
SHDocter asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @SHDocter,

Here is a demo for adding and removing elements dynamically:

container = ui.row()

def add_face():
    with container:
        ui.icon('face')
add_face()

ui.button('Add', on_click=add_face)
ui.button('Remove', on_click=lambda: container.remove(0) if list(container) else None)
ui.button('Clear', on_click=container.clear)

This should work for scroll areas as well.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SHDocter
Comment options

Answer selected by SHDocter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants