Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mastodon
GitHub Repository: mastodon/joinmastodon
Path: blob/main/components/Input.tsx
1006 views
1
import {
2
Input as HeadlessInput,
3
InputProps as HeadlessInputProps,
4
} from "@headlessui/react"
5
import classNames from "classnames"
6
7
export type InputProps = HeadlessInputProps & {
8
fullWidth?: boolean
9
}
10
11
export function Input({
12
className,
13
disabled,
14
fullWidth = false,
15
...props
16
}: InputProps) {
17
return (
18
<HeadlessInput
19
className={classNames(
20
className,
21
fullWidth && "w-full",
22
"px-4 py-2 rounded-md outline-none transition-all",
23
"border border-blurple-500 focus:shadow-input",
24
"placeholder:text-gray-2",
25
"disabled:border-gray-2"
26
)}
27
disabled={disabled}
28
{...props}
29
/>
30
)
31
}
32
33