Skip to content

Commit c1501a8

Browse files
committed
add default input styles to playground
Similar to the `Button` styles, just used for some playground stuff while testing locally.
1 parent af5b0b4 commit c1501a8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)