Form Input

GitHub

Text input connected to Form context with server validation errors.

Installation

bash
pnpm dlx shadcn@latest add @cs/form-input

Usage

tsx
import { FormInput } from "@/components/cs/form-input"
tsx
<FormInput name="email" />

API Reference

FormInput

Text input connected to Form context with server validation errors.

Props

NameTypeDefaultDescription
buttonOmit<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> | undefined-Button displayed inside the input on the right.
iconReactNode-Icon displayed inside the input on the left.
inputClassNamestring | undefined-Additional classes applied to the native input control.
labelReactNode-Field label and fallback placeholder.
name *string-Form field name used for submission and validation errors.
orientation"vertical" | "horizontal" | "responsive" | null | undefined-Layout of the field label and input control.