@molecule/app-price-range-slider-solid
Feature · price-range-slider · App (browser) · v1.1.3 · Apache-2.0
Single- or dual-handle range slider with formatted labels
npm install @molecule/app-price-range-slider-solidHow it works
@molecule/app-price-range-slider-solid is a ready-made price-range-slider feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.
import { createSignal } from 'solid-js'
import { PriceRangeSlider } from '@molecule/app-price-range-slider-solid'
export function PriceFilter() {
const [range, setRange] = createSignal<[number, number]>([50, 500])
return (
<PriceRangeSlider
min={0}
max={1000}
value={range()}
onChange={setRange}
step={10}
label="Price range"
formatValue={(n) => `$${n}`}
/>
)
}Works with: @molecule/app-solid, @molecule/app-ui, @molecule/app-ui-solid
Reference
Solid numeric min/max range picker.
Solid counterpart of @molecule/app-price-range-slider-react — the same
props (React names) and the same DOM for the same input. Exports
PriceRangeSlider — TWO native <input type="range"> controls rendered
side by side (min slider + max slider) with formatted endpoint labels. The
handles clamp against each other so low <= high always holds. It is not a
single-track dual-thumb slider.
Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit
src/index.tsJSDoc, not this file.
Quick Start
import { createSignal } from 'solid-js'
import { PriceRangeSlider } from '@molecule/app-price-range-slider-solid'
export function PriceFilter() {
const [range, setRange] = createSignal<[number, number]>([50, 500])
return (
<PriceRangeSlider
min={0}
max={1000}
value={range()}
onChange={setRange}
step={10}
label="Price range"
formatValue={(n) => `$${n}`}
/>
)
}
Type
feature
Installation
npm install @molecule/app-price-range-slider-solid @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js
API
Interfaces
PriceRangeSliderProps
Props accepted by the PriceRangeSlider component.
interface PriceRangeSliderProps {
/** Minimum possible value. */
min: number
/** Maximum possible value. */
max: number
/** Current [low, high] tuple. If only one value is relevant, set low === min. */
value: [number, number]
/** Called whenever either handle moves. */
onChange?: (value: [number, number]) => void
/** Step increment. Defaults to 1. */
step?: number
/** Called to format each endpoint label — defaults to USD currency formatting. */
formatValue?: (n: number) => string
/** Optional label above. */
label?: JSX.Element
/** Extra classes. */
className?: string
}
Functions
PriceRangeSlider(props)
PriceRangeSlider component.
Dual-handle numeric range slider using two native <input type="range">
controls. Apps supply min/max/step and a formatValue to render the
endpoint labels (typical use: currency-formatted prices). The handles clamp
against each other so low <= high always holds. This is the Solid
counterpart of @molecule/app-price-range-slider-react's PriceRangeSlider:
the same props (React names), the same ClassMap tokens, and the same DOM for
the same input.
function PriceRangeSlider(props: PriceRangeSliderProps): JSX.Element
props— Component props (seePriceRangeSliderProps).
Returns: The rendered slider.
Injection Notes
Requirements
Peer dependencies:
@molecule/app-solid^3.14.0 || ^4.0.0@molecule/app-ui^1.0.1@molecule/app-ui-solid^1.1.0solid-js^1.8.0
Runtime Dependencies
@molecule/app-solid@molecule/app-ui@molecule/app-ui-solidsolid-js
The default formatValue renders US-style dollars ($1,000) — always pass
your own formatter for non-USD apps. The two sliders' aria-labels
("Minimum"/"Maximum") translate through t()
(priceRangeSlider.aria.minimum/priceRangeSlider.aria.maximum), so they
follow the active locale. Requires a wired ClassMap bond (getClassMap()).
Translations
Translation strings are provided by @molecule/app-locales-price-range-slider.