Reactive Pages
Reactive pages allow you to dynamically update the form based on user input. This is achieved by defining a page as a function that returns a list of widgets. The function can access the
current state and modify the page accordingly.
The example below creates a simple rating page that shows a message based on the user's rating.
- Initially,
state["rating"]isNone, so the page only displays theRatingInputwidget. - When the user provides a rating, the page is re-evaluated.
- If the rating is less than 3, a message is appended to the page and displayed immediately.