{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "text-field", "type": "registry:ui", "title": "Text Field", "description": "Label + input + description/error composite.", "registryDependencies": [ "https://raw.githubusercontent.com/truongnat/rnui/main/registry/dist/nativewind/utils.json", "https://raw.githubusercontent.com/truongnat/rnui/main/registry/dist/nativewind/form.json", "https://raw.githubusercontent.com/truongnat/rnui/main/registry/dist/nativewind/input.json" ], "files": [ { "path": "registry/shared/ui/text-field.tsx", "type": "registry:ui", "target": "components/ui/text-field.tsx", "content": "import {\n FormDescription,\n FormField,\n FormLabel,\n FormMessage,\n} from '@/components/ui/form';\nimport { Input, type InputProps } from '@/components/ui/input';\nimport { cn } from '@/lib/utils';\n\nexport interface TextFieldProps extends InputProps {\n /** Label above the input. Appends ` *` when `required`. */\n label?: string;\n /** Appends ` *` to the label. */\n required?: boolean;\n /** Helper text under the input — hidden while `error` is set. */\n description?: string;\n /** Error message; also marks the input invalid via FormFieldContext. */\n error?: string;\n labelClassName?: string;\n descriptionClassName?: string;\n /** Classes for the Input itself — `className` targets the field container. */\n inputClassName?: string;\n}\n\n/**\n * Composite field: label + input + description/error message, wired through\n * `FormFieldContext` so `Input` picks up `nativeID` and the destructive\n * border automatically.\n */\nexport function TextField({\n label,\n required,\n description,\n error,\n className,\n labelClassName,\n descriptionClassName,\n inputClassName,\n ...inputProps\n}: TextFieldProps) {\n const labelText = required && label ? `${label} *` : label;\n return (\n \n {label ? (\n {labelText}\n ) : null}\n \n {error ? (\n \n ) : description ? (\n \n {description}\n \n ) : null}\n \n );\n}\n" } ] }