When rendering the labels (on handle, and pips) both for screen and readers; the values can be prefixed or suffixed with a string to add context to the values.
Simple € Prefix
Here we will add a simple € prefix, this is a common use-case, and demonstrates that the prefix is applied both to the handles and pips-labels, however you can see the actual output-value is still just a number.
Just as with the prefix, we can supply a suffix prop which will be appended to the value in the UI. This is useful for adding a simple symbol to the end of values.
suffix and prefix can be combined for some interesting effects, here we will add a prefix of ”~” and a suffix of ” 🎈”, showing off how the values are still just numbers, but the UI is more interesting/meaningful.
<script>let values = [99];constprefix="~";constsuffix=" 🎈";$: final = prefix + values[0] + suffix; // reactive final value for use</script><RangeSlider{prefix}{suffix}floatpipslast="label"range="min"max={99} step={9} bind:values /><codetitle="The output slider values"data-values> {values} | {final}</code>