← All Components
<mth-range-slider>
Form-associated dual-thumb range slider with independent start and end ARIA slider thumbs, min-distance clamping, and RTL support.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Live Interactive Preview
Ready · interact with <mth-range-slider>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/range-slider"></script>
<mth-range-slider value="25,75" default-value="25,75"></mth-range-slider>import '@methane-ui/ui/range-slider';
import '@methane-ui/react';
export function Example() {
return <mth-range-slider value="25,75" default-value="25,75"></mth-range-slider>;
}<script setup lang="ts">
import '@methane-ui/ui/range-slider';
</script>
<template>
<mth-range-slider value="25,75" default-value="25,75"></mth-range-slider>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/range-slider';
import { MthRangeSliderDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthRangeSliderDirective],
template: `<mth-range-slider value="25,75" default-value="25,75"></mth-range-slider>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/range-slider';
import MthRangeSlider from '@methane-ui/svelte/MthRangeSlider.svelte';
</script>
<MthRangeSlider value="25,75" default-value="25,75"></MthRangeSlider>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
name | name | string | "" | Form submission field name. |
value | value | string | "25,75" | Comma-separated pair "start,end". |
defaultValue | default-value | string | "25,75" | Default "start,end" restored on form reset. |
start | start | number | 25 | Current start value. |
end | end | number | 75 | Current end value. |
min | min | number | 0 | Minimum selectable value. |
max | max | number | 100 | Maximum selectable value. |
step | step | number | 1 | Step increment. |
minDistance | min-distance | number | 0 | Minimum gap maintained between start and end thumbs. |
label | label | string | "" | Accessible group label. |
hint | hint | string | "" | Helper message. |
error | error | string | "" | Validation error message. |
size | size | 'sm' | 'md' | 'lg' | "md" | Visual scale. |
showValue | show-value | boolean | false | Shows formatted start - end values. |
disabled | disabled | boolean | false | Disables both thumbs. |
readonly | readonly | boolean | false | Prevents edits while keeping focusability. |
formatValue | — | ((value: number) => string) | null | null | Custom numeric formatter. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-input | { start: number; end: number; value: string } | Dispatched while dragging or stepping either thumb. |
mth-change | { start: number; end: number; value: string } | Dispatched when a thumb adjustment commits. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowRight | ltr | either thumb focused | increases focused thumb value by step |
| ArrowLeft | rtl | either thumb focused | increases focused thumb value in RTL |
| PageUp / PageDown | both | either thumb focused | moves focused thumb by ten steps |
| Home / End | both | either thumb focused | moves focused thumb to valid lower/upper bound |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | delegatesFocus: true with zero host internals.role (ADR-014). | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 4 APG keyboard transitions across LTR/RTL. | mth-range-slider.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(dirty), :state(touched), :state(user-invalid), :state(disabled). | Conformance suite |
| i18n | Routes 3 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |