Add a mr.Examples component for loading predefined widget values.
API
mr.Examples(
examples={
"Young customer": {
"age": 25,
"country": "Poland",
},
"Enterprise customer": {
"age": 45,
"country": "Germany",
},
}
)
Dictionary keys should match existing Mercury widget key or url_key.
Behavior
Show available examples in the app:
Examples
[ Young customer ]
[ Enterprise customer ]
When an example is clicked:
- Find widgets by
key, then url_key.
- Set all provided widget values.
- Trigger notebook execution once after all values are updated.
Missing widget keys should produce a warning.
V1 scope
- predefined examples only
- explicit widget values
- no automatic widget discovery
- no saving/editing examples from the UI
- no outputs or scenario management
Goal: let users quickly populate an app with meaningful example inputs.
Add a
mr.Examplescomponent for loading predefined widget values.API
Dictionary keys should match existing Mercury widget
keyorurl_key.Behavior
Show available examples in the app:
When an example is clicked:
key, thenurl_key.Missing widget keys should produce a warning.
V1 scope
Goal: let users quickly populate an app with meaningful example inputs.