Input

A labelled form field with left and right icon slots: setting error shakes it, turns the border red and blurs a message in underneath, while success draws a check mark at the right edge. Works controlled or uncontrolled, with a classNames hook for every part.

Preview

Input preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/input
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

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
—

Updated