vwf .

API Reference

Complete API documentation for components, utilities, and framework core

Reference/API/Slider

Slider

Range slider with visual progress bar (uses inline styles for --progress variable)

🔧 Props

PropertyTypeDefaultDescription
idstringslider-{timestamp}Unique identifier
labelstringundefinedLabel text
valueState|numberundefinedSlider value (NOT auto-bound)
minnumber0Minimum value
maxnumber100Maximum value
stepnumber1Step increment
showValuebooleantrueShow current value
valueFormatstringundefined'percent', 'currency', 'distance'
oninput*function-Input handler (required - value NOT auto-bound)
containerClassstring-Container classes (vwfcolor, vwfsize)

🎨 Utility Classes

PatternDescription
vwfcolor-{color}Sets slider color
vwfsize-{size}Controls slider size

💻 Examples

Volume Slider

const volume = van.state(50);
return Slider({
  label: 'Volume',
  value: volume,
  min: 0,
  max: 100,
  oninput: (e) => volume.val = e.target.value
});

▶️ Live Preview

[object Object]

💡 Click "Edit Code" to modify the example

🔄 Click "Apply Changes" to see your modifications

↩️ Click "Reset" to restore original code

💡 Usage Tips

🔗 Related

Explore vwf

Discover what vwf can do