A copyable player/world form block with validation and reset.
Preview
Usage
Install the form item and import its actual FormExample export from @/components/form. This is a registry block, not a library of Form, FormField or FormProvider primitives. The primary example runs that block, including its real validation, disabled state, save result and reset action.
Composition
The block composes React Hook Form Controller, zodResolver, Zod, Field, Input, Textarea and Button. Keep Controller's value/onChange/ref on the input, connect error IDs with aria-describedby and set aria-invalid explicitly. It uses noValidate so the schema owns validation.
API and accessibility
The schema requires a player name of at least two characters and a world name; notes are a string. FieldSet and the actual controls are both disabled. Reset uses form.reset. scale defaults to 2. Field layout, validation and save feedback are web adaptations, not a native Minecraft form screen. Manual installation includes the block and its complete helpers/resources; dependencies include react-hook-form, @hookform/resolvers and zod.
See the underlying API for shared semantics.
Validation composition
Installation
Component source
This is the component implementation. Its supporting styles, helpers and resources are also required. See complete manual installation.
"use client";
import { zodResolver } from "@hookform/resolvers/zod";
import * as React from "react";
import type { CSSProperties as IntrinsicLayoutCSSProperties } from "react";
import { Controller, useForm } from "react-hook-form";
import { z } from "zod";
import { Button } from "@/components/ui/button";
import {
Field,
FieldContent,