Skip to main content

Input

A text input with a blur-drift character reveal, ghost exit on delete, animated clear button, and invalid shake.

Characters14

Customize

SizeMedium (md)
Type blur (px)4
Horizontal drift (px)6
Speed1

Installation

npx shadcn@latest add @kinetic/input

Usage

import { Input } from "@/components/kinetic/ui/input";

export function NameField() {
  return <Input placeholder="Your name" aria-label="Name" />;
}

Sizes

Use size with sm, md, or lg. The default is md.

<Input size="sm" placeholder="Small" aria-label="Small" />
<Input size="lg" placeholder="Large" aria-label="Large" />

Clearable

Set clearable to show an animated clear button while the field has a value. Use clearLabel to set its accessible name.

<Input clearable clearLabel="Clear search" defaultValue="Kinetic" aria-label="Search" />

Value changes

onValueChange receives the new string directly. The input also works as a controlled field with value and onChange.

const [query, setQuery] = React.useState("");

<Input value={query} onValueChange={setQuery} aria-label="Query" />

Reveal tuning

blurPx and driftPx control the blur and horizontal travel of each typed character, and speed scales the animation duration. The reveal applies to type values text, search, url, and tel; other types use the native text rendering, and so does blurPx={0}. Composition input, such as Vietnamese IME, is handled safely: the reveal pauses while composing.

<Input blurPx={6} driftPx={10} speed={1.5} aria-label="Tuned" />

Invalid state

Set invalid to mark the field with aria-invalid and play a short shake when the field becomes invalid. aria-invalid="true" also triggers it.

<Input invalid aria-label="Email" defaultValue="not-an-email" />

Motion preferences

Character reveal, ghost exit, and the shake respect the Kinetic reduced-motion setting and the browser preference; when reduced motion is active the text changes without animation. Durations use the current tempo and the speed prop.

API Reference

Input

Zero-dependency text input with synced character mirror overlay for horizontal blur-drift typing and deleting, IME safety, clear button, and invalid shake.

PropTypeDefaultDescription
value / defaultValue / onValueChangestring / (value: string) => void-Controlled or uncontrolled string value and convenient change callback.
blurPx / driftPxnumber4 / 6Blur radius (px) and horizontal drift distance (px) for inserted and deleted characters.
clearable / invalidbooleanfalse / falseShows an animated clear button when non-empty, or triggers invalid styling and micro-shake.
size / speed / disabled"sm" | "md" | "lg" / number / boolean"md" / 1 / falseInput height scale, animation speed multiplier (0.25-4), and disabled state.

Notes

Always pair Input with FieldLabel or Label via matching id and htmlFor. Inside InputGroup, use InputGroupInput instead of raw Input.