I realized way too late I can define the callback INSIDE homepage()
im not sure if they provide a particular way to reference UI elements across functions without sharing the label object directly, but yeah, closures is certainly one way to do it alternatively a class could be suitable for your use case too, possibly something like: ```py @ui.page("/xyz") def xyz(): XYZPage() class XYZPage: def __init__(self): self.label = ui.label("Hello world!") self.button = ui.button("Click me!", on_click=self.on_click) def on_click(self): self.label.set_text("You clicked my button!")``` this is just extrapolating from what i could find on their docs so i cant tell exactly if it works, but it does seem weird that their examples lack any demonstration of code architecture beyond top-level functions