Tension Slider
Install the component, then paste your configured usage. Your settings are included in the code below.
npx arclen-ui add tension-slider --settings eyJ0aGVtZSI6ImRhcmsiLCJ2YWx1ZSI6MzYsImxhYmVsIjoiVmFsdWUiLCJoaW50Ijp0cnVlLCJ3YXZlU3RyZW5ndGgiOjEsIndhdmVXaWR0aCI6Mi41LCJ3YXZlRGFtcGluZyI6OCwid2F2ZVNwZWVkIjozOCwiZmxpZ2h0RHVyYXRpb24iOjQyNSwiYWNjZW50IjoiI2Q0NDYxMSIsIm1hcmtlclNpemUiOjEyLCJ0aWNrVGhpY2tuZXNzIjozLCJoZWxwVGV4dCI6IlNsaWRlIGFsb25nIHRoZSBzY2FsZSB0byBzZXQgYSB2YWx1ZS5cblB1bGwgdGhlIG1hcmtlciBiYWNrIGFuZCByZWxlYXNlIHRvIGxhdW5jaC4iLCJwYW5lbFdpZHRoIjo2NzAsImhlYWRyb29tIjoxMTAsImJvdHRvbVNwYWNlIjoyMiwic2hvd1ZhbHVlIjp0cnVlLCJ2YWx1ZUdhcCI6MjAsInZhbHVlU2l6ZSI6NDQsInZhbHVlV2VpZ2h0Ijo0MDAsInZhbHVlU3VmZml4IjoiIiwic2hvd0xhYmVsIjpmYWxzZSwibGFiZWxTaXplIjoxMywiaGludFdpZHRoIjoyNzksImhpbnRTaXplIjoxMywiaGludEdhcCI6MTAsImhpbnRBbGlnbiI6ImNlbnRlciIsInRpY2tDb3VudCI6NTksImZpbGxlZEhlaWdodCI6NDgsImVtcHR5SGVpZ2h0IjozMiwiZW1wdHlUaGlja25lc3MiOjEwMCwidGlja1JhZGl1cyI6MywibGlnaHRJbmsiOiIjMTcxODE5IiwiZGFya0luayI6IiNmNGYzZjEiLCJsaWdodExpbmUiOiIjODk4ZDkwIiwiZGFya0xpbmUiOiIjODA4NThhIiwibGlnaHRNdXRlZCI6IiM2NTY4NmEiLCJkYXJrTXV0ZWQiOiIjYjBiMmI0IiwibWFya2VyR2FwIjo4LCJtYXJrZXJSaW5nIjoxLCJtYXJrZXJSYWRpdXMiOjUwLCJncmlwV2lkdGgiOjQwLCJmb2N1c09mZnNldCI6NSwicmVhZG91dFJlc3BvbnNlIjoxLCJtYXJrZXJTcHJpbmciOjEsIm1hcmtlckRhbXBpbmciOjEsInNjcnViTGlmdCI6MTAwLCJzY3J1YlN3aW5nIjoxMDAsInB1bGxUcmF2ZWwiOjk2LCJsYXVuY2hQb3dlciI6MSwiYXJjSGVpZ2h0IjoxLCJwdWxsTGVhbiI6MSwiYmFuZFdpZHRoIjoxLjUsImJhbmRPcGFjaXR5Ijo4NCwiYXJjV2lkdGgiOjEsImFyY09wYWNpdHkiOjYwLCJkYXNoTGVuZ3RoIjoyLCJkYXNoR2FwIjozLCJzaG93UHJlZGljdGlvbiI6ZmFsc2UsInRhcmdldFNjYWxlIjoxMDAsInRyYWlsTGVuZ3RoIjozNSwidHJhaWxXaWR0aCI6MSwidHJhaWxPcGFjaXR5IjozMiwiYm91bmNlSGVpZ2h0IjoxMDAsImJvdW5jZVRpbWUiOjE2MCwiaW1wYWN0U3RyZW5ndGgiOjEwMCwia2V5Ym9hcmRTdGVwIjoxLCJwYWdlU3RlcCI6MTB9import { TensionSlider } from "@/components/tension-slider";
export default function Example() {
return <TensionSlider {...{
"theme": "dark",
"value": 36,
"label": "Value",
"hint": true,
"waveStrength": 1,
"waveWidth": 2.5,
"waveDamping": 8,
"waveSpeed": 38,
"flightDuration": 425,
"accent": "#d44611",
"markerSize": 12,
"tickThickness": 3,
"helpText": "Slide along the scale to set a value.\nPull the marker back and release to launch.",
"panelWidth": 670,
"headroom": 110,
"bottomSpace": 22,
"showValue": true,
"valueGap": 20,
"valueSize": 44,
"valueWeight": 400,
"valueSuffix": "",
"showLabel": false,
"labelSize": 13,
"hintWidth": 279,
"hintSize": 13,
"hintGap": 10,
"hintAlign": "center",
"tickCount": 59,
"filledHeight": 48,
"emptyHeight": 32,
"emptyThickness": 100,
"tickRadius": 3,
"lightInk": "#171819",
"darkInk": "#f4f3f1",
"lightLine": "#898d90",
"darkLine": "#80858a",
"lightMuted": "#65686a",
"darkMuted": "#b0b2b4",
"markerGap": 8,
"markerRing": 1,
"markerRadius": 50,
"gripWidth": 40,
"focusOffset": 5,
"readoutResponse": 1,
"markerSpring": 1,
"markerDamping": 1,
"scrubLift": 100,
"scrubSwing": 100,
"pullTravel": 96,
"launchPower": 1,
"arcHeight": 1,
"pullLean": 1,
"bandWidth": 1.5,
"bandOpacity": 84,
"arcWidth": 1,
"arcOpacity": 60,
"dashLength": 2,
"dashGap": 3,
"showPrediction": false,
"targetScale": 100,
"trailLength": 35,
"trailWidth": 1,
"trailOpacity": 32,
"bounceHeight": 100,
"bounceTime": 160,
"impactStrength": 100,
"keyboardStep": 1,
"pageStep": 10
}} />;
}| Property | Type | Default |
|---|---|---|
themeTheme Options: dark (Dark), light (Light) | select | "light" |
valueValue 0–100Step 1 | number | 36 |
labelAccessible label Up to 80 characters | text | "Value" |
hintGesture hint | boolean | true |
waveStrengthWave strength 0–2Step 0.05 | number | 1 |
waveWidthWave width (bars) 1–8Step 0.25 | number | 2.5 |
waveDampingWave damping 3–18Step 0.5 | number | 8 |
waveSpeedWave speed (bars/s) 15–65Step 1 | number | 38 |
flightDurationFlight time (ms) 240–750Step 5 | number | 425 |
accentMarker color | color | "#d44611" |
markerSizeMarker diameter (px) 6–22Step 1 | number | 12 |
tickThicknessFilled tick width (px) 1–6Step 0.5 | number | 3 |
helpTextGesture instructions Up to 180 characters | text | "Slide along the scale to set a value.\nPull the marker back and release to launch." |
panelWidthMaximum slider width (px) 260–840Step 1 | number | 670 |
headroomSpace above track (px) 30–155Step 1 | number | 110 |
bottomSpaceSpace below track (px) 4–64Step 1 | number | 22 |
showValueShow numeric value | boolean | true |
valueGapGap after track (px) 4–46Step 1 | number | 20 |
valueSizeValue size (px) 22–54Step 1 | number | 44 |
valueWeightValue weight 300–750Step 50 | number | 400 |
valueSuffixValue unit Up to 8 characters | text | "" |
showLabelDisplay accessible label | boolean | false |
labelSizeLabel size (px) 10–22Step 1 | number | 13 |
hintWidthInstructions width (px) 160–600Step 1 | number | 279 |
hintSizeInstructions size (px) 10–20Step 1 | number | 13 |
hintGapInstructions gap (px) 0–40Step 1 | number | 10 |
hintAlignInstructions alignment Options: left (Left), center (Center), right (Right) | select | "center" |
tickCountNumber of ticks 19–87Step 1 | number | 59 |
filledHeightFilled tick height (px) 18–70Step 1 | number | 48 |
emptyHeightEmpty tick height (px) 8–58Step 1 | number | 32 |
emptyThicknessEmpty tick width multiplier (%) 30–300Step 1 | number | 100 |
tickRadiusTick corner radius (px) 0–6Step 0.25 | number | 3 |
lightInkLight value and filled ticks | color | "#171819" |
darkInkDark value and filled ticks | color | "#f4f3f1" |
lightLineLight empty ticks | color | "#898d90" |
darkLineDark empty ticks | color | "#80858a" |
lightMutedLight caption and instructions | color | "#65686a" |
darkMutedDark caption and instructions | color | "#b0b2b4" |
markerGapClearance above filled tick (px) 0–24Step 0.5 | number | 8 |
markerRingMarker inner ring (px) 0–3Step 0.25 | number | 1 |
markerRadiusMarker rounding (%) 0–50Step 1 | number | 50 |
gripWidthMarker grab area (px) 32–60Step 1 | number | 40 |
focusOffsetKeyboard outline offset (px) 1–12Step 1 | number | 5 |
readoutResponseReadout response (×) 0.55–1.6Step 0.05 | number | 1 |
markerSpringMarker stiffness (×) 0.55–1.65Step 0.05 | number | 1 |
markerDampingMarker damping (×) 0.6–1.65Step 0.05 | number | 1 |
scrubLiftSpeed-sensitive lift (%) 0–200Step 5 | number | 100 |
scrubSwingSideways swing (%) 0–160Step 5 | number | 100 |
pullTravelMaximum elastic draw (px) 48–128Step 1 | number | 96 |
launchPowerThrow distance (×) 0.4–1.7Step 0.05 | number | 1 |
arcHeightFlight height (×) 0.5–1.35Step 0.05 | number | 1 |
pullLeanTick lean (×) 0–1.6Step 0.1 | number | 1 |
bandWidthElastic band width (px) 0.5–4Step 0.25 | number | 1.5 |
bandOpacityElastic band opacity (%) 0–100Step 1 | number | 84 |
arcWidthGuide width (px) 0.5–3Step 0.25 | number | 1 |
arcOpacityGuide opacity (%) 0–100Step 1 | number | 60 |
dashLengthDash length (px) 1–12Step 0.5 | number | 2 |
dashGapDash spacing (px) 0–12Step 0.5 | number | 3 |
showPredictionShow value over landing point | boolean | false |
targetScaleLanding ring size (%) 50–160Step 5 | number | 100 |
trailLengthFlight trail length (%) 0–70Step 1 | number | 35 |
trailWidthTrail width (px) 0.5–4Step 0.25 | number | 1 |
trailOpacityTrail opacity (%) 0–100Step 1 | number | 32 |
bounceHeightRebound height (%) 0–180Step 5 | number | 100 |
bounceTimeRebound duration (ms) 65–350Step 5 | number | 160 |
impactStrengthImpact wave (%) 0–180Step 5 | number | 100 |
keyboardStepArrow key increment 1–10Step 1 | number | 1 |
pageStepPage key increment 1–50Step 1 | number | 10 |
Tension Slider
Set a value between 0 and 100 on a graduated track. Press or drag the scale for direct adjustment. Pull the marker away from the destination, then release to send it to the projected value.
React
import { TensionSlider } from './components/tension-slider';
<TensionSlider label="Input level" value={36} onValueChange={setInputLevel} />Component is an alias for TensionSlider. Omit value to start at the default and keep the value in the slider. Subsequent changes to the value prop move the slider. onValueChange reports distinct user changes during a scrub and reports the projected value once on release. className, style, and paused configure the wrapper and lifecycle.
HTML and vanilla
import { mount } from './components/tension-slider/src/core';
import './components/tension-slider/src/styles.css';
const slider = mount(document.querySelector('#level')!, { label: 'Input level' });
slider.update({ theme: 'light', hint: false });Updates accept partial settings. Programmatic changes emit no event. User changes also dispatch a bubbling tension-slider-change with detail.value. Call pause() to disable interaction, resume() to restore it and destroy() when removing the host.
Gestures and accessibility
Direct scrubbing follows the pointer across the ruled scale. Pulling the marker shows the projected value and the flight path. A short pull, Escape or pointer cancellation clears the projection. A vertical pull increases the height of the path. Releasing commits the value immediately. During flight, the visible scale and number count toward that committed value. A new gesture during the animation starts from the committed value.
Tab reaches a native range input. Arrow keys adjust by keyboardStep (default 1), Page Up and Page Down adjust by pageStep (default 10), and Home and End select the limits. With reduced motion, the pull preview remains visible and the marker moves directly to its landing point on release. Static output displays the value with the input disabled until mounted.
Tuning the wave
Every bar has its own displacement and velocity. A scrub or flying marker excites the nearby bars, and their springs pass that motion along the scale. The landing adds a second impulse. The readout and change event use the selected value throughout.
waveStrength controls the height of the disturbance. Zero keeps the bars stationary. waveWidth is the width of the contact in bars, and waveSpeed is the propagation speed in bars per second. Increase waveDamping for a shorter tail. flightDuration sets the reference flight time in milliseconds. Taller arcs take longer. accent colors the marker, trajectory, and landing target.
<TensionSlider waveWidth={3} waveSpeed={44} waveStrength={1.25}
waveDamping={7} flightDuration={375} accent="#c95724" />The spring clock stops after the last bar settles. Pausing, destruction, scrolling offscreen and switching to reduced motion clear the wave immediately.
Marker, ticks, and instructions
markerSize sets the diameter of both the marker and its landing outline, in nominal desktop pixels. The grip keeps its larger pointer target. tickThickness sets the width of each filled graduation. Unfilled graduations use a third of that width by default. emptyThickness scales the unfilled width independently. The narrowest strokes have a minimum visible width.
Set helpText to change the instructions. A line break starts a new line. The native range announces this text while the hint is visible. Set hint={false} or use an empty string to hide it.
Preview controls
| Group | What you can adjust | | --- | --- | | Layout | Maximum width, clearance above the marker and space below the scale. | | Readout | Number visibility, size, weight, suffix and distance from the scale. Show the accessible label above the slider and set its size. | | Instructions | Copy, visibility, line width, type size, vertical gap and alignment. | | Track | Tick count, filled and empty tick dimensions, and corner radius. Density changes preserve the selected value. | | Palette | Independent light and dark colors for the filled scale, empty graduations and instructions. | | Marker | Accent, diameter, clearance, ring weight, corner rounding, grip target and keyboard focus offset. | | Scrub response | Number catch-up speed, marker spring and damping, vertical lift and horizontal swing on fast drags. | | Wave | Amplitude, contact width, propagation speed and damping. | | Launch | Maximum pull, throw distance, flight time, arc height and how far the marker leans into the pull. | | Aim guides | Band and trajectory strokes, opacity, dash pattern, landing target scale and optional projected number. | | Trail and landing | Trail length, width and opacity, rebound height and time, and the impact sent through the ticks. | | Keyboard | Arrow-key and page-key increments. |
To isolate a motion, scrub quickly across the ticks for swing and lift, or drag the marker away from the desired landing point for the aim guides and trail. Controls update the mounted slider. Changing the tick count rebuilds the tick field at the current value.
The preview runs the component’s own JavaScript. It respects reduced motion and pauses when off screen. The HTML bundle includes a static fallback.
Every setting in this panel comes from the component manifest. Preview size, pause and replay stay in the inspector.