Home / File/ field.tsx — ui Source File

field.tsx — ui Source File

Architecture documentation for field.tsx, a tsx file in the ui codebase. 5 imports, 0 dependents.

File tsx ComponentRegistry UIPrimitives 5 imports 10 functions

Entity Profile

Dependency Diagram

graph LR
  7f790981_1f57_27c9_6405_8857e98ddfef["field.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  7f790981_1f57_27c9_6405_8857e98ddfef --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  25383e8d_ca91_a50e_c3a8_5f228d02e1df["class-variance-authority"]
  7f790981_1f57_27c9_6405_8857e98ddfef --> 25383e8d_ca91_a50e_c3a8_5f228d02e1df
  8ad666ec_1b20_adda_0392_87a60bdb3a68["utils"]
  7f790981_1f57_27c9_6405_8857e98ddfef --> 8ad666ec_1b20_adda_0392_87a60bdb3a68
  00db19de_4bff_5fd7_3fcb_a9b94babaf3b["label"]
  7f790981_1f57_27c9_6405_8857e98ddfef --> 00db19de_4bff_5fd7_3fcb_a9b94babaf3b
  a3c00059_fa03_cf5e_4e2a_284c527e1995["separator"]
  7f790981_1f57_27c9_6405_8857e98ddfef --> a3c00059_fa03_cf5e_4e2a_284c527e1995
  style 7f790981_1f57_27c9_6405_8857e98ddfef fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import { useMemo } from "react"
import { cva, type VariantProps } from "class-variance-authority"

import { cn } from "@/registry/bases/base/lib/utils"
import { Label } from "@/registry/bases/base/ui/label"
import { Separator } from "@/registry/bases/base/ui/separator"

function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {
  return (
    <fieldset
      data-slot="field-set"
      className={cn("cn-field-set flex flex-col", className)}
      {...props}
    />
  )
}

function FieldLegend({
  className,
  variant = "legend",
  ...props
}: React.ComponentProps<"legend"> & { variant?: "legend" | "label" }) {
  return (
    <legend
      data-slot="field-legend"
      data-variant={variant}
      className={cn("cn-field-legend", className)}
      {...props}
    />
  )
}

function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="field-group"
      className={cn(
        "cn-field-group group/field-group @container/field-group flex w-full flex-col",
        className
      )}
      {...props}
    />
  )
}

const fieldVariants = cva("cn-field group/field flex w-full", {
  variants: {
    orientation: {
      vertical:
        "cn-field-orientation-vertical flex-col *:w-full [&>.sr-only]:w-auto",
      horizontal:
        "cn-field-orientation-horizontal flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
      responsive:
        "cn-field-orientation-responsive flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
    },
  },
  defaultVariants: {
    orientation: "vertical",
// ... (168 more lines)

Subdomains

Dependencies

  • class-variance-authority
  • label
  • react
  • separator
  • utils

Frequently Asked Questions

What does field.tsx do?
field.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, UIPrimitives subdomain.
What functions are defined in field.tsx?
field.tsx defines 10 function(s): Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle.
What does field.tsx depend on?
field.tsx imports 5 module(s): class-variance-authority, label, react, separator, utils.
Where is field.tsx in the architecture?
field.tsx is located at apps/v4/registry/bases/base/ui/field.tsx (domain: ComponentRegistry, subdomain: UIPrimitives, directory: apps/v4/registry/bases/base/ui).

Analyze Your Own Codebase

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

Try Supermodel Free