We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af5b0b4 commit c1501a8Copy full SHA for c1501a8
playgrounds/react/components/input.tsx
@@ -0,0 +1,19 @@
1
+import { ComponentProps, forwardRef, ReactNode } from 'react'
2
+
3
+function classNames(...classes: (string | false | undefined | null)[]) {
4
+ return classes.filter(Boolean).join(' ')
5
+}
6
7
+export let Input = forwardRef<HTMLInputElement, ComponentProps<'input'> & { children?: ReactNode }>(
8
+ ({ className, ...props }, ref) => (
9
+ <input
10
+ ref={ref}
11
+ type="text"
12
+ className={classNames(
13
+ 'focus:outline-hidden ui-focus-visible:ring-2 ui-focus-visible:ring-offset-2 flex items-center rounded-md border border-gray-300 bg-white px-2 py-1 ring-gray-500 ring-offset-gray-100',
14
+ className
15
+ )}
16
+ {...props}
17
+ />
18
+ )
19
+)
0 commit comments