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.
SelectField is a reusable dropdown component that wires shadcn/ui’s Select primitives into ShaddyForm’s form context. Pass an array of { value, text } option objects, and the component handles rendering SelectItem elements, syncing the selected value with react-hook-form, and displaying validation errors automatically.
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.Array of option objects.
value is stored in the form state and passed to your schema; text is what the user sees in the dropdown list and in the trigger when an option is selected.Label text rendered above the select trigger. Omit to hide the label.
Placeholder shown inside the
SelectTrigger when no value is selected.When
true, appends a red asterisk to the label as a visual indicator.Additional CSS classes applied to the outermost
FormItem wrapper.Notes
SelectFieldmust be rendered inside a<ShaddyForm>— it readscontrolfromuseFormContextinternally.- Only string values are supported out of the box. If you need numeric or boolean values, convert them in your
onSubmithandler or use a Zod transform. - The
optionsarray is rendered in the order it is provided. - Validation errors are rendered automatically below the select via shadcn/ui’s
<FormMessage>.