I have a Range slider component and I want it to fill the line with color as you move the dot along the range slider. I read the documentation here, but didn't find anything helpful. I was also looking into the text moving with the dot right under it rather than just static text. Anyone know if this is possible with Flowbite and Tailwind?
The component:
const RangeSlider = (props) => {
const { min, max, value, step, onChange, className } = props;
return (
<input
type="range"
value={value}
min={min}
max={max}
step={step}
onChange={onChange}
className={`transparent h-2 w-full cursor-pointer appearance-none rounded-lg border-transparent accent-green-700 hover:accent-green-700 active:accent-green-800 bg-gray-100 ${className}`}
/>
);
};
export default RangeSlider;
This is the code on the page:
<RangeSlider min={5} max={500} value={rangeSliderValue} onChange={handleRangeSlider} />
<div className="flex justify-center">
<p className="pl-4 text-center text-sm font-medium">
{parseInt(rangeSliderValue, 10) === 5 ? 'minimum of ' : ''} {rangeSliderValue} Vehicles
</p>
</div>
Here's how the code renders:
Here's an image mocked up of what I want it to look like, but doesn't look like I can even do a border on an accent element with tailwind.