BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn-zhcndoc/form
This component no longer exists. It was in shadcn-zhcndoc’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-14 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

shadcn-zhcndoc/form
RemovedComponent

shadcn-zhcndoc publishes no description for this item.

Live preview

live · rendered by the registry
Rendered by shadcn-zhcndoc on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://shadcn.zhcndoc.com/r/styles/new-york/form.json

Source

ui/form.tsxshadcn.zhcndoc.com/r/styles/new-york/form.json
1"use client"
2
3import * as React from "react"
4import * as LabelPrimitive from "@radix-ui/react-label"
5import { Slot } from "@radix-ui/react-slot"
6import {
7 Controller,
8 FormProvider,
9 useFormContext,
10 type ControllerProps,
11 type FieldPath,
12 type FieldValues,
13} from "react-hook-form"
14
15import { cn } from "@/lib/utils"
16import { Label } from "@/registry/new-york/ui/label"
17
18const Form = FormProvider
19
20type FormFieldContextValue<
21 TFieldValues extends FieldValues = FieldValues,
22 TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
23> = {
24 name: TName
25}
26
27const FormFieldContext = React.createContext<FormFieldContextValue | null>(null)
28
29const FormField = <
30 TFieldValues extends FieldValues = FieldValues,
31 TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
32>({
33 ...props
34}: ControllerProps<TFieldValues, TName>) => {
35 return (
36 <FormFieldContext.Provider value={{ name: props.name }}>
37 <Controller {...props} />
38 </FormFieldContext.Provider>
39 )
40}
41
42const useFormField = () => {
43 const fieldContext = React.useContext(FormFieldContext)
44 const itemContext = React.useContext(FormItemContext)
45 const { getFieldState, formState } = useFormContext()
46
47 if (!fieldContext) {
48 throw new Error("useFormField should be used within <FormField>")
49 }
50
51 if (!itemContext) {
52 throw new Error("useFormField should be used within <FormItem>")
53 }
54
55 const fieldState = getFieldState(fieldContext.name, formState)
56
57 const { id } = itemContext
58
59 return {
60 id,
61 name: fieldContext.name,
62 formItemId: `${id}-form-item`,
63 formDescriptionId: `${id}-form-item-description`,
64 formMessageId: `${id}-form-item-message`,
65 ...fieldState,
66 }
67}
68
69type FormItemContextValue = {
70 id: string
71}
72
73const FormItemContext = React.createContext<FormItemContextValue | null>(null)
74
75const FormItem = React.forwardRef<
76 HTMLDivElement,
77 React.HTMLAttributes<HTMLDivElement>
78>(({ className, ...props }, ref) => {
79 const id = React.useId()
80
81 return (
82 <FormItemContext.Provider value={{ id }}>
83 <div ref={ref} className={cn("space-y-2", className)} {...props} />
84 </FormItemContext.Provider>
85 )
86})
87FormItem.displayName = "FormItem"
88
89const FormLabel = React.forwardRef<
90 React.ElementRef<typeof LabelPrimitive.Root>,
91 React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
92>(({ className, ...props }, ref) => {
93 const { error, formItemId } = useFormField()
94
95 return (
96 <Label
97 ref={ref}
98// … truncated

Facts

Registry
shadcn-zhcndoc
Type
registry:ui
Access
Free
Files written
0
Licence
MIT
In the index
at or before 2026-08-08
Last confirmed
5 days ago

Go to the source

Docs on shadcn-zhcndoc shadcn.zhcndoc.com zhcndoc/shadcn on GitHub Raw registry item This item as JSON

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex