Input

A single-line native text field with IME, selection and undo/redo.

Import

import { Input } from "@tarve/core";

Usage

Input.tsx
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

PropTypeDefault
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 →

childrenhighlightidkeymotionFromonHighlightonPasteonTransitionEndrovingGroupstyle

Types

InputType
type InputType = "text" | "password" | "email" | "number" | "search" | "tel" | "url";