This component no longer exists. It was in neobrutal-ui’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-06 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
Form
neobrutal-ui/formRemovedComponent
neobrutal-ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by neobrutal-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://neobrutal-ui.andongmin.com/r/form.jsonSource
1"use client";23import {4 Controller,5 FormProvider,6 useFormContext,7 useFormState,8 type ControllerProps,9 type FieldPath,10 type FieldValues,11} from "react-hook-form";12import { useRender } from "@base-ui/react/use-render";1314import * as React from "react";1516import { Label } from "@/components/ui/label";1718import { cn } from "@/lib/utils";1920const Form = FormProvider;2122type FormFieldContextValue<23 TFieldValues extends FieldValues = FieldValues,24 TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,25> = {26 name: TName;27};2829const FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);3031function FormField<32 TFieldValues extends FieldValues = FieldValues,33 TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,34>({ ...props }: ControllerProps<TFieldValues, TName>) {35 return (36 <FormFieldContext.Provider value={{ name: props.name }}>37 <Controller {...props} />38 </FormFieldContext.Provider>39 );40}4142const useFormField = () => {43 const fieldContext = React.useContext(FormFieldContext);44 const itemContext = React.useContext(FormItemContext);45 const { getFieldState } = useFormContext();46 const formState = useFormState({ name: fieldContext.name });47 const fieldState = getFieldState(fieldContext.name, formState);4849 if (!fieldContext) {50 throw new Error("useFormField should be used within <FormField>");51 }5253 const { id } = itemContext;5455 return {56 id,57 name: fieldContext.name,58 formItemId: `${id}-form-item`,59 formDescriptionId: `${id}-form-item-description`,60 formMessageId: `${id}-form-item-message`,61 ...fieldState,62 };63};6465type FormItemContextValue = {66 id: string;67};6869const FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);7071function FormItem({ className, ...props }: React.ComponentProps<"div">) {72 const id = React.useId();7374 return (75 <FormItemContext.Provider value={{ id }}>76 <div data-slot="form-item" className={cn("grid gap-2", className)} {...props} />77 </FormItemContext.Provider>78 );79}8081function FormLabel({ className, ...props }: React.ComponentProps<typeof Label>) {82 const { error, formItemId } = useFormField();8384 return (85 <Label86 data-slot="form-label"87 data-error={!!error}88 className={cn("font-heading", className)}89 htmlFor={formItemId}90 {...props}91 />92 );93}9495type FormControlProps = React.HTMLAttributes<HTMLElement> & {96 children?: React.ReactNode;97};9899// … truncated
What it pulls in
npm packages
Other registry items
