input-range.tsx 694 B

12345678910111213141516171819202122232425262728293031323334353637
  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. }
  12. export function InputRange({
  13. onChange,
  14. title,
  15. value,
  16. className,
  17. min,
  18. max,
  19. step,
  20. }: InputRangeProps) {
  21. return (
  22. <div className={styles["input-range"] + ` ${className ?? ""}`}>
  23. {title || value}
  24. <input
  25. type="range"
  26. title={title}
  27. value={value}
  28. min={min}
  29. max={max}
  30. step={step}
  31. onChange={onChange}
  32. ></input>
  33. </div>
  34. );
  35. }