A host-rendered numeric control with a typed value action.
Signature
type Slider {
label: Str = "Slider";
action: func(Number) -> Res[Unit, DataError] = ignore_number;
min: Number = 0;
max: Number = 1;
value: Number = 0;
}The host supplies a Number to action. A callback accepting input owns any update to Slider.value; schema construction and host input do not mutate it automatically.
Fields
label: Str- Visible label; defaults to Slider.Default
"Slider" action: func(f64) -> Res[Unit, DataError]- Typed callback accepting the requested numeric value; defaults to ignore_number.Default
ignore_number min: f64- Lower requested bound; defaults to 0. Hosts should present min no greater than max.Default
0 max: f64- Upper requested bound; defaults to 1. Hosts should present max no less than min.Default
1 value: f64- Current requested numeric value; defaults to 0 and changes only through explicit checked state updates.Default
0
Examples
Inspect defaults
The default range is 0 through 1.
Show a QR code for your glasses, or send a link to another browser. You can keep working here.
Sharing starts a fresh run of the last compiled code. Your editor draft stays here.
Join a session
Open an invitation link, or paste a link or code from the other device.
On RayNeo, open Menu → Connect live and scan this code. In another browser, open the invitation link below.
Or enter this code:
Waiting for another device. You can keep working while it connects.
Browsers can edit code; every device can use scene controls. The device that started the session controls playback.
Connection settings
A full invitation link includes its host. With a code alone, both devices need the same live host. Pairing setup
No output.
- Executed source spans appear here.
Expected output
1
Expose a changeable control
Change Gain: set_gain clamps the input, updates the stored Slider value, and logs the accepted value.
Show a QR code for your glasses, or send a link to another browser. You can keep working here.
Sharing starts a fresh run of the last compiled code. Your editor draft stays here.
Join a session
Open an invitation link, or paste a link or code from the other device.
On RayNeo, open Menu → Connect live and scan this code. In another browser, open the invitation link below.
Or enter this code:
Waiting for another device. You can keep working while it connects.
Browsers can edit code; every device can use scene controls. The device that started the session controls playback.
Connection settings
A full invitation link includes its host. With a code alone, both devices need the same live host. Pairing setup
No output.
- Executed source spans appear here.
Expected output
slider ready
Rust definition
Interpreter RecordValue UI schema; host input dispatch owns actual slider interaction.