MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / TextField

Function TextField

apps/web/ui/TextField/index.tsx:23–61  ·  view source on GitHub ↗
({
  className,
  label,
  id,
  type,
  placeholder,
  value,
  defaultValue,
  required,
  disabled = false,
  readOnly = false,
  onChange,
  onBlur,
  onKeyDown,
  autoFocus,
  ...rest
}: Props)

Source from the content-addressed store, hash-verified

21}
22
23export default function TextField({
24 className,
25 label,
26 id,
27 type,
28 placeholder,
29 value,
30 defaultValue,
31 required,
32 disabled = false,
33 readOnly = false,
34 onChange,
35 onBlur,
36 onKeyDown,
37 autoFocus,
38 ...rest
39}: Props) {
40 return (
41 <Field>
42 {label && <Label htmlFor={id}>{label}</Label>}
43 <TextInput
44 className={className}
45 id={id}
46 type={type}
47 placeholder={placeholder}
48 value={value}
49 defaultValue={defaultValue}
50 required={required}
51 disabled={disabled}
52 readOnly={readOnly}
53 onChange={onChange}
54 onBlur={onBlur}
55 onKeyDown={onKeyDown}
56 autoFocus={autoFocus}
57 {...rest}
58 />
59 </Field>
60 );
61}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected