input-range.tsx 744 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import * as React from "react";
  2. import styles from "./input-range.module.scss";
  3. interface InputRangeProps {
  4. onChange: React.ChangeEventHandler<HTMLInputElement>;
  5. title?: string;
  6. value: number | string;
  7. className?: string;
  8. min: string;
  9. max: string;
  10. step: string;
  11. aria: string;
  12. }
  13. export function InputRange({
  14. onChange,
  15. title,
  16. value,
  17. className,
  18. min,
  19. max,
  20. step,
  21. aria,
  22. }: InputRangeProps) {
  23. return (
  24. <div className={styles["input-range"] + ` ${className ?? ""}`}>
  25. {title || value}
  26. <input
  27. aria-label={aria}
  28. type="range"
  29. title={title}
  30. value={value}
  31. min={min}
  32. max={max}
  33. step={step}
  34. onChange={onChange}
  35. ></input>
  36. </div>
  37. );
  38. }