Documentation Index
Fetch the complete documentation index at: https://mintlify.com/rijvi-mahmud/shaddy/llms.txt
Use this file to discover all available pages before exploring further.
TextField is a reusable text input component that connects directly to ShaddyForm’s form context via react-hook-form. It supports labels, required indicators, optional icons, action buttons, a loading spinner, and flexible CSS overrides — all while wiring validation messages automatically through FormMessage.
Installation
Install all ShaddyForm fields at once with theshaddy-form registry item:
Usage
Props
The field name. Must match a key in your Zod schema passed to
ShaddyForm.Label text rendered above the input. Omit to hide the label entirely.
The HTML input type. Use
'email' or 'number' to get native browser behaviour and the matching Zod validation.Placeholder text shown inside the input when it is empty.
When
true, a red asterisk is appended to the label as a visual indicator. Actual validation is controlled by your Zod schema.Callback fired when the action button on the right side of the input is clicked. When provided, a button is rendered using the
icon prop (or a default ✕ icon).An icon node to render on the right side of the input. Used as the button content when
action is set, or as a static icon otherwise.When
true, replaces the right-side icon with an animated LoadingSpinner. Useful for async operations triggered from the field.Disables the underlying
<Input> element when true.Additional Tailwind / CSS classes applied to the outermost
FormItem wrapper.Additional CSS classes applied directly to the
<Input> element.Additional CSS classes applied to the icon container or the action button.
Notes
TextFieldmust be rendered inside a<ShaddyForm>— it readscontrolfromuseFormContextinternally.- The
actionprop andiconprop work together: if both are provided, the icon becomes the button’s content; if onlyiconis given, it renders as a static decoration; if onlyactionis given, a default red ✕ icon is used. - Validation messages are rendered automatically below the input via shadcn/ui’s
<FormMessage>.