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

Function TextInput

apps/web/ui/TextInput/index.tsx:35–107  ·  view source on GitHub ↗
({
  className,
  type,
  id,
  name,
  placeholder,
  required,
  label,
  defaultValue,
  value,
  style,
  disabled = false,
  readOnly = false,
  icon,
  inputRef,
  onChange,
  onInput,
  onBlur,
  onFocus,
  onKeyDown,
  onKeyUp,
  autoComplete,
  autoFocus,
  title,
  pattern,
  size,
  rounded,
  ...rest
}: Props)

Source from the content-addressed store, hash-verified

33}
34
35function TextInput({
36 className,
37 type,
38 id,
39 name,
40 placeholder,
41 required,
42 label,
43 defaultValue,
44 value,
45 style,
46 disabled = false,
47 readOnly = false,
48 icon,
49 inputRef,
50 onChange,
51 onInput,
52 onBlur,
53 onFocus,
54 onKeyDown,
55 onKeyUp,
56 autoComplete,
57 autoFocus,
58 title,
59 pattern,
60 size,
61 rounded,
62 ...rest
63}: Props) {
64 return (
65 <>
66 {label && <Label htmlFor={id}>{label}</Label>}
67 <div className={styles.container}>
68 {icon && (
69 <div
70 className={classNames(styles.icon, { [styles.lg]: size === 'lg' })}
71 >
72 {icon}
73 </div>
74 )}
75 <input
76 ref={inputRef}
77 className={classNames(styles.input, className, {
78 [styles.lg]: size === 'lg',
79 [styles.rounded]: rounded === 'full',
80 [styles.disabled]: disabled,
81 })}
82 type={type}
83 id={id}
84 name={id || name}
85 placeholder={placeholder}
86 required={required}
87 defaultValue={defaultValue}
88 value={value}
89 disabled={disabled}
90 readOnly={readOnly}
91 onChange={onChange}
92 onInput={onInput}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected