Input
A single-line native text field with IME, selection and undo/redo.
Import
import { Input } from "@tarve/core";Usage
import { Input } from "@tarve/core";
let email = "";
<Input
type="email"
value={email}
placeholder="you@example.com"
onChange={(value) => {
email = value;
}}
onSubmit={(value) => console.log("submitted", value)}
/>Props
| Prop | Type | Default |
|---|---|---|
disabled | boolean | — |
onChange | (value: string) => void | — |
onSubmit Enter (with or without modifiers) submits the current value. | (value: string) => void | — |
placeholder | string | — |
type | InputType | "text" |
value | string | — |
Common props
Shared by every component. See descriptions →
childrenhighlightidkeymotionFromonHighlightonPasteonTransitionEndrovingGroupstyleTypes
type InputType = "text" | "password" | "email" | "number" | "search" | "tel" | "url";