Input

Component used for collecting data from users

Preview

Usage

import { z } from 'zod';
import { AutoForm } from '@vitnode/core/components/form/auto-form';
import { AutoFormInput } from '@vitnode/core/components/form/fields/input';
const formSchema = z.object({
  username: z.string().min(3, "Username must be at least 3 characters"),
  email: z.email("Please enter a valid email address"),
});
<AutoForm
  formSchema={formSchema}
  fields={[
    {
      id: "username",
      component: props => (
        <AutoFormInput
          {...props}
          description="This is the username for your application. It should be unique and not shared with anyone."
          label="Username"
        />
      ),
    },
    {
      id: "email",
      component: props => (
        <AutoFormInput
          {...props}
          description="We'll use this email to contact you."
          label="Email Address"
        />
      ),
    },
  ]}
/>
import { Input } from '@vitnode/core/components/ui/input';
<Input />

Props

Prop

Type

On this page