输入框

带标签、左右图标的文本输入框,支持错误抖动提示与成功状态的对勾绘制动画。

安装

用 shadcn CLI 添加,或手动复制源码。

$ bunx --bun shadcn add @uilab/input

API 参考

label?
string
value?
string
defaultValue?
string
onChange?
((value: string) => void)
error?
string | boolean

Truthy error triggers a shake, red border and (if a string) a message.

success?
boolean
leftIcon?
ReactNode
rightIcon?
ReactNode
className?
string
classNames?
InputClassNames

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.