Open History to see the last commit
1import * as React from 'react'
2import { type inputVariantProps, inputVariants } from './variants'
3β
4type InputProps = React.InputHTMLAttributes<HTMLInputElement> &
5 Omit<inputVariantProps, 'type'> & {
6 invalid?: boolean
7 }
8β
9const Input = React.forwardRef<HTMLInputElement, InputProps>(
10 ({ className, type, invalid = false, ...props }, ref) => {
11 return (
12 <input
13 className={inputVariants({
14 className,
15 type,
16 invalid,
17 } as inputVariantProps)}
18 type={type}
19 ref={ref}
20 {...props}
21 />
22 )
23 },
24)
25β
26Input.displayName = 'Input'
27β
28export { Input, inputVariants, type InputProps }