Docs menu

Input

A pill-shaped text field that looks pressed into the page. In kawaii mode every keystroke kicks a sparkle up from the caret, and deleting leaves a little puff.

Installation

❯ npx shadcn@latest add https://yan.moe/r/input.json

Usage

tsx
import { Input } from "@/components/ui/input"
tsx
<Input type="email" placeholder="[email protected]" />

Mark a field invalid with aria-invalid and it turns coral:

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

Accessibility

  • It renders a native <input>, so every input type, autofill and form validation work as usual.
  • Always pair it with a <label> (or aria-label); the placeholder is not a label.
  • The keystroke sparkles are decorative, throttled, and skipped with prefers-reduced-motion: reduce.

API

PropTypeDefault
intensity

kawaii: sparkles off the caret as you type, a puff when you delete. subtle and off keep only the focus ring.

"kawaii" | "subtle" | "off""kawaii"
fx

Overrides for the per-keystroke burst.

BurstOptions-
...props

Everything a native input accepts.

React.ComponentProps<"input">-