BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/skeuomorph-krzysztof/form

form

skeuomorph-krzysztof/form
FreeComponent

skeuomorph-krzysztof publishes no description for this item.

Live preview

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

Install it

npx shadcn@latest add https://skeuomorph.krzysztof.studio/r/styles/new-york/form.json

Source

ui/form.tsxskeuomorph.krzysztof.studio/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

What it pulls in

npm packages

  • @radix-ui/react-label
  • @radix-ui/react-slot
  • @hookform/resolvers
  • zod
  • react-hook-form

Other registry items

  • button
  • label

Files it writes

  • ui/form.tsx

Facts

Registry
skeuomorph-krzysztof
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-09
Last confirmed
today

Go to the source

Docs on skeuomorph-krzysztof skeuomorph.krzysztof.studio krzysztoff1/ui-skeuomorph on GitHub Raw registry item This item as JSON

More from skeuomorph-krzysztof

All 54 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordionskeuomorph-krzysztofComponentsFree1 dep
alertalertskeuomorph-krzysztofComponentsFreeno deps
alert-dialogalert-dialogskeuomorph-krzysztofComponentsFree1 dep
aspect-ratioaspect-ratioskeuomorph-krzysztofComponentsFree1 dep
avataravatarskeuomorph-krzysztofComponentsFree1 dep
badgebadgeskeuomorph-krzysztofComponentsFree1 dep
breadcrumbbreadcrumbskeuomorph-krzysztofComponentsFree1 dep
buttonbuttonskeuomorph-krzysztofComponentsFree1 dep

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