Slider Component

Axiom01 provides styling for native HTML range input elements, allowing users to select a value from a specified range. For more complex slider functionalities (e.g., dual-thumb sliders, custom tooltips), integration with a third-party JavaScript library is recommended.

Live Example

Basic Range Slider

50

Disabled Slider

70

HTML Structure

The slider component uses the native HTML <input type="range"> element.

<div class="slider-container">
			<label for="volume-slider">Volume:</label>
			<input type="range" id="volume-slider" min="0" max="100" value="50">
			<span id="volume-value">50</span>
	</div>

Styling

Axiom01 provides base styling for the <input type="range"> element to ensure it looks consistent across browsers and themes. This includes styling the track and the thumb of the slider.

JavaScript Integration

To display the current value of the slider or to implement more complex interactions, you will need JavaScript.

<script>
			const volumeSlider = document.getElementById('volume-slider');
			const volumeValue = document.getElementById('volume-value');

			volumeSlider.addEventListener('input', (event) => {
					volumeValue.textContent = event.target.value;
			});
	</script>

Accessibility

The native <input type="range"> element is inherently accessible. Ensure you:

Customization

Customize the appearance using Axiom01's CSS variables for colors (e.g., --a-color-primary for the thumb and filled track), spacing, and typography. You can also target the pseudo-elements (::-webkit-slider-thumb, ::-moz-range-thumb, etc.) for deeper styling control.