Home / Function/ FormLabel() — ui Function Reference

FormLabel() — ui Function Reference

Architecture documentation for the FormLabel() function in form.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  f4e0d5d3_9509_e7b4_b483_1e99f02c7c1c["FormLabel()"]
  26832279_f22a_39e6_9194_59ea47194309["form.tsx"]
  f4e0d5d3_9509_e7b4_b483_1e99f02c7c1c -->|defined in| 26832279_f22a_39e6_9194_59ea47194309
  94429819_53f2_f220_12d8_b0229985d8e4["useFormField()"]
  f4e0d5d3_9509_e7b4_b483_1e99f02c7c1c -->|calls| 94429819_53f2_f220_12d8_b0229985d8e4
  style f4e0d5d3_9509_e7b4_b483_1e99f02c7c1c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/registry/new-york-v4/ui/form.tsx lines 90–105

function FormLabel({
  className,
  ...props
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
  const { error, formItemId } = useFormField()

  return (
    <Label
      data-slot="form-label"
      data-error={!!error}
      className={cn("data-[error=true]:text-destructive", className)}
      htmlFor={formItemId}
      {...props}
    />
  )
}

Subdomains

Frequently Asked Questions

What does FormLabel() do?
FormLabel() is a function in the ui codebase, defined in apps/v4/registry/new-york-v4/ui/form.tsx.
Where is FormLabel() defined?
FormLabel() is defined in apps/v4/registry/new-york-v4/ui/form.tsx at line 90.
What does FormLabel() call?
FormLabel() calls 1 function(s): useFormField.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free