Form Text Input
GitHubText input connected to Form context with server validation errors.
Installation
bash
pnpm dlx shadcn@latest add @cs/form-text-inputUsage
tsx
import { FormTextInput } from "@/components/cs/form-text-input"tsx
<FormTextInput name="description" />API Reference
FormTextInput
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. |
| defaultValue | string | undefined | - | Initial text value for uncontrolled usage. |
| 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. |
| onValueChange | ((value: string) => void) | undefined | - | Called with the current text value when it changes. |
| orientation | "vertical" | "horizontal" | "responsive" | null | undefined | - | Layout of the field label and input control. |
| value | string | undefined | - | Controlled text value. |