Form Item API

FormItem

<FormItem /> is a layout component for form fields, grouping label, input, description, and message.

Props

NameTypeDescription
childrenReactNodeThe content of the form item.
componentstringThe HTML element to render (default: 'div').
classNamestringAdditional CSS classes.

Example

<FormItem component="div" className="mb-4">
  <FormLabel>Email</FormLabel>
  <FormControl>
    <Input {...field} />
  </FormControl>
  <FormMessage />
</FormItem>