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 const id = createUniqueId()
17 const descriptionId = `${id}-description`
18
19 const handleChange = (e: Event) => {
20 const value = (e.target as HTMLInputElement).value
21 setVal(value)
22 props.onChange?.(value)
23 }
24
25 return (
26 <div class={styles().inputContainer}>
27 <div class={styles().inputWrapper}>
28 {props.label && (
29 <label for={id} class={styles().inputLabel}>
30 {props.label}
31 </label>
32 )}
33 {props.description && (
34 <p id={descriptionId} class={styles().inputDescription}>
35 {props.description}
36 </p>
37 )}
38 <input
39 id={id}
40 data-tsd-control
41 aria-describedby={props.description ? descriptionId : undefined}
42 type={props.type || 'text'}
43 class={styles().input}
44 value={val()}
45 placeholder={props.placeholder}

Callers

nothing calls this directly

Calls 1

createStylesFunction · 0.90

Tested by

no test coverage detected