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 |
|---|---|---|
autoFocus Focus the field when it first appears (HTML `autofocus`), e.g. in a dialog that just opened. | boolean | — |
disabled | boolean | — |
glass A Liquid Glass capsule field. | GlassProp | — |
maxLength The most characters the user can bring the value to (HTML `maxlength`): typing past it is dropped, a paste is cut to fit. | number | — |
onChange | (value: string) => void | — |
onSubmit Enter (with or without modifiers) submits the current value. | (value: string) => void | — |
placeholder | string | — |
readOnly Focusable, selectable and copyable, but the user cannot edit it (HTML `readonly`). The app can still change `value`. | boolean | — |
type | InputType | "text" |
value | string | — |
Common props
Shared by every component. See descriptions →
childrenclassclassNamehighlightidkeymotionFromonHighlightonPasteonPointerLeaveonPointerMoveonSizeonTransitionEndrovingGroupstyleTypes
type GlassProp = boolean | GlassVariant | GlassOptions;type InputType = "text" | "password" | "email" | "number" | "search" | "tel" | "url";