Input

Captures text input from the user.

inputs
form
text
field

Preview

Variants

Default input field.

Code

TSX
1
2
3
4
5
import { Input } from "@/components/ui/input"

export function InputDemo() {
  return <Input placeholder="Email" />
}

API Reference

PropTypeDefaultDescription
typestringtextType of the input (text, email, password, etc.)
placeholderstring-Text to display when the input is empty.
disabledboolean-Whether the input is disabled.
requiredboolean-Whether the input is required in a form.
valuestring-The controlled value of the input.
onChangefunction-Event handler called when the input's value changes.