MsSettingInput.svelte view source
import MsSettingInput from '@fuzdev/zzz/MsSettingInput.svelte'; A millisecond setting as a range slider plus a number field. Both are
one-way: the slider commits as it moves (its values are always in
range), the number field commits on change (blur or Enter) so the
setter's coercion and clamping don't fight each keystroke. After a
commit the field shows the value the setter kept.
id?
The number field's id, for an external <label for>.
type
stringoptional
label
Accessible name for the slider, which has no <label> of its own.
type
stringvalue
The current setting.
type
numberbounds
type MsSettingBounds
range_max?
Slider maximum, when the useful range is narrower than bounds — the
number field still accepts up to bounds.max.
type
numberoptional default
bounds.maxstep
type
numberonvalue
Commits a new value — NaN for an empty field; the setter decides what to keep.
type
(value: number) => voidsnippet parameters
value number