Form Input
GitHubText input connected to Form context with server validation errors.
Installation
bash
pnpm dlx shadcn@latest add @cs/form-inputUsage
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
| Name | Type | Default | Description |
|---|---|---|---|
| button | Omit<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> | undefined | - | Button displayed inside the input on the right. |
| icon | ReactNode | - | Icon displayed inside the input on the left. |
| inputClassName | string | undefined | - | Additional classes applied to the native input control. |
| label | ReactNode | - | 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. |