VitNode
Forms

Tag Input

Tag Input is a component that allows users to input tags.

Unstable component

This component is unstable and may change in the future.

Preview

Usage

import { z } from 'zod';
import { AutoForm } from 'vitnode-frontend/form/auto-form';
import { AutoFormTagInput } from 'vitnode-frontend/form/fields/tags';
import { zodTag } from 'vitnode-frontend/helpers/zod';
const formSchema = z.object({
  keywords: zodTag,
});
<AutoForm
  formSchema={formSchema}
  fields={[
    {
      id: 'keywords',
      component: AutoFormTagInput,
    },
  ]}
/>

Multiple

<AutoForm
  formSchema={formSchema}
  fields={[
    {
      id: 'keywords',
      component: props => <AutoFormTagInput {...props} multiple />,
    },
  ]}
/>

API Reference

PropTypeDefault
onChange
TagInputItemProps | TagInputItemProps[] | undefined
-
value
TagInputItemProps | TagInputItemProps[]
-
placeholder
string
-
multiple
boolean
false
disabled
boolean
false

On this page