MCPcopy Create free account
hub / github.com/TanStack/devtools / Input

Function Input

packages/devtools-ui/src/components/input.tsx:13–42  ·  view source on GitHub ↗
(props: InputProps)

Source from the content-addressed store, hash-verified

11}
12
13export function Input(props: InputProps) {
14 const styles = createStyles()
15 const [val, setVal] = createSignal(props.value || '')
16
17 const handleChange = (e: Event) => {
18 const value = (e.target as HTMLInputElement).value
19 setVal((prev) => (prev !== value ? value : prev))
20 props.onChange?.(value)
21 }
22
23 return (
24 <div class={styles().inputContainer}>
25 <div class={styles().inputWrapper}>
26 {props.label && (
27 <label class={styles().inputLabel}>{props.label}</label>
28 )}
29 {props.description && (
30 <p class={styles().inputDescription}>{props.description}</p>
31 )}
32 <input
33 type={props.type || 'text'}
34 class={styles().input}
35 value={val()}
36 placeholder={props.placeholder}
37 onInput={handleChange}
38 />
39 </div>
40 </div>
41 )
42}

Callers

nothing calls this directly

Calls 1

createStylesFunction · 0.90

Tested by

no test coverage detected