MsSettingInput.svelte

view source

Declarations
#

MsSettingInput
#

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 string
optional

label

Accessible name for the slider, which has no <label> of its own.

type string

value

The current setting.

type number

bounds

range_max?

Slider maximum, when the useful range is narrower than bounds — the number field still accepts up to bounds.max.

type number
optional default bounds.max

step

type number

onvalue

Commits a new value — NaN for an empty field; the setter decides what to keep.

type (value: number) => void
snippet parameters
value number

Depends on
#

Imported by
#