You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
942 B

  1. import React, { InputHTMLAttributes } from "react";
  2. export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
  3. sizeClass?: string;
  4. fontClass?: string;
  5. rounded?: string;
  6. }
  7. // eslint-disable-next-line react/display-name
  8. const Input = React.forwardRef<HTMLInputElement, InputProps>(
  9. (
  10. {
  11. className = "",
  12. sizeClass = "h-11 px-4 py-3",
  13. fontClass = "text-sm font-normal",
  14. rounded = "rounded-2xl",
  15. children,
  16. type = "text",
  17. ...args
  18. },
  19. ref
  20. ) => {
  21. return (
  22. <input
  23. ref={ref}
  24. type={type}
  25. className={`block w-full border-neutral-200 focus:border-primary-300 focus:ring focus:ring-primary-200 focus:ring-opacity-50 bg-white dark:border-neutral-700 dark:focus:ring-primary-6000 dark:focus:ring-opacity-25 dark:bg-neutral-900 ${rounded} ${fontClass} ${sizeClass} ${className}`}
  26. {...args}
  27. />
  28. );
  29. }
  30. );
  31. export default Input;