BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/cubby-ui/field

Field

cubby-ui/field
FreeComponent

A field component.

Live preview

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

Install it

npx shadcn@latest add https://cubby-ui.dev/r/field.json

Source

registry/default/field/field.tsxcubby-ui.dev/r/field.json
1"use client";
2
3import * as React from "react";
4import { Field as BaseField } from "@base-ui/react/field";
5
6import { cn } from "@/lib/utils";
7import { inputVariants } from "@/registry/default/input/input";
8
9function Field({ className, ...props }: BaseField.Root.Props) {
10 return (
11 <BaseField.Root
12 data-slot="field"
13 className={cn("space-y-2", className)}
14 {...props}
15 />
16 );
17}
18
19function FieldLabel({ className, ...props }: BaseField.Label.Props) {
20 return (
21 <BaseField.Label
22 data-slot="field-label"
23 className={cn(
24 "text-foreground flex items-center gap-2 text-sm leading-5 font-medium select-none",
25 "data-disabled:pointer-events-none data-disabled:opacity-60",
26 "data-invalid:text-destructive",
27 className,
28 )}
29 {...props}
30 />
31 );
32}
33
34function FieldControl({ className, ...props }: BaseField.Control.Props) {
35 return (
36 <BaseField.Control
37 data-slot="field-control"
38 className={cn(inputVariants(), className)}
39 {...props}
40 />
41 );
42}
43
44function FieldDescription({
45 className,
46 ...props
47}: BaseField.Description.Props) {
48 return (
49 <BaseField.Description
50 data-slot="field-description"
51 className={cn("text-muted-foreground text-sm", className)}
52 {...props}
53 />
54 );
55}
56
57function FieldError({ className, ...props }: BaseField.Error.Props) {
58 return (
59 <BaseField.Error
60 data-slot="field-error"
61 className={cn("text-destructive text-sm", className)}
62 {...props}
63 />
64 );
65}
66
67function FieldErrorSlot({ className, ...props }: React.ComponentProps<"div">) {
68 return (
69 <div
70 data-slot="field-error-slot"
71 className={cn(
72 "-mt-2 grid h-0 overflow-clip [interpolate-size:allow-keywords] *:col-start-1 *:row-start-1",
73 "ease-out-expo transition-[height,margin-top] duration-140 motion-reduce:transition-none",
74 "has-[[data-slot=field-error]:not([data-ending-style])]:mt-0 has-[[data-slot=field-error]:not([data-ending-style])]:h-auto",
75 // Opacity fade on child FieldError
76 "*:data-[slot=field-error]:transition-opacity *:data-[slot=field-error]:duration-140 motion-reduce:*:data-[slot=field-error]:transition-none",
77 "[&>[data-slot=field-error][data-ending-style]]:opacity-0 [&>[data-slot=field-error][data-starting-style]]:opacity-0",
78 // When swapping errors: instantly hide the exiting one, show the entering one.
79// … truncated

What it pulls in

Other registry items

  • @cubby-ui/input

Files it writes

  • registry/default/field/field.tsx

Facts

Registry
cubby-ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-01
Last confirmed
today

Go to the source

Docs on cubby-ui cubby-ui.dev joncoronel/cubby-ui on GitHub Raw registry item This item as JSON

More from cubby-ui

All 79 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordioncubby-uiComponentsFree2 deps
Alertalertcubby-uiComponentsFree1 dep
Alert-dialogalert-dialogcubby-uiComponentsFree2 deps
Aspect-ratioaspect-ratiocubby-uiComponentsFreeno deps
Autocompleteautocompletecubby-uiComponentsFree2 deps
Avataravatarcubby-uiComponentsFree1 dep
Badgebadgecubby-uiComponentsFree1 dep
Base Drawerbase-drawercubby-uiComponentsFree2 deps
BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex