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.jsonUsage
import { Input } from "@/components/ui/input"<Input type="email" placeholder="[email protected]" />Mark a field invalid with aria-invalid and it turns coral:
<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>(oraria-label); the placeholder is not a label. - The keystroke sparkles are decorative, throttled, and skipped with
prefers-reduced-motion: reduce.
API
| Prop | Type | Default |
|---|---|---|
intensitykawaii: sparkles off the caret as you type, a puff when you delete. subtle and off keep only the focus ring. | "kawaii" | "subtle" | "off" | "kawaii" |
fxOverrides for the per-keystroke burst. | BurstOptions | - |
...propsEverything a native input accepts. | React.ComponentProps<"input"> | - |