Form

Form primitives.

Use Form to manage validation, values, and submission.

We'll never share your email.

import { Form, FormField, FormItem, FormLabel, FormControl, Input, FormDescription, FormMessage, Button } from '@tile-ui/react';

export default function FormDemo() {
	return (
		<Form>
			<FormField

Registry install

pnpm dlx shadcn@latest add @tile-ui/form

Package usage

import { Form, FormField, FormLabel, FormControl, Input, FormMessage } from '@tile-ui/react';
 
<Form>
	<FormField name="email">
		<FormLabel>Email</FormLabel>
		<FormControl>
			<Input />
		</FormControl>
		<FormMessage />
	</FormField>
</Form>

Highlights

  • useForm hook
  • Field, label, control, and message
  • Resolver validation

Registry dependencies

ItemPurpose
formComponent source and module styles
coreFramework-agnostic logic helpers
stylesShared SCSS tokens and globals

API reference

Form

PropTypeDefault
defaultValuesRecord<string, unknown>
resolver(values: FormValues) => FormErrors | Promise<FormErrors>
formunknown