input-range.tsx 762 B

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