field
agileflow-projectquestorg/fieldFreeComponent
shadcn/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/projectquestorg/AgileFlow/main/apps/docs/public/r/styles/radix-nova/field.jsonSource
1"use client"23import { useMemo } from "react"4import { cva, type VariantProps } from "class-variance-authority"56import { cn } from "@/registry/bases/radix/lib/utils"7import { Label } from "@/registry/bases/radix/ui/label"8import { Separator } from "@/registry/bases/radix/ui/separator"910function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {11 return (12 <fieldset13 data-slot="field-set"14 className={cn("gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col", className)}15 {...props}16 />17 )18}1920function FieldLegend({21 className,22 variant = "legend",23 ...props24}: React.ComponentProps<"legend"> & { variant?: "legend" | "label" }) {25 return (26 <legend27 data-slot="field-legend"28 data-variant={variant}29 className={cn("mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base", className)}30 {...props}31 />32 )33}3435function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {36 return (37 <div38 data-slot="field-group"39 className={cn(40 "gap-5 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4 group/field-group @container/field-group flex w-full flex-col",41 className42 )}43 {...props}44 />45 )46}4748const fieldVariants = cva("data-[invalid=true]:text-destructive gap-2 group/field flex w-full", {49 variants: {50 orientation: {51 vertical:52 "flex-col [&>*]:w-full [&>.sr-only]:w-auto",53 horizontal:54 "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",55 responsive:56 "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",57 },58 },59 defaultVariants: {60 orientation: "vertical",61 },62})6364function Field({65 className,66 orientation = "vertical",67 ...props68}: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>) {69 return (70 <div71 role="group"72 data-slot="field"73 data-orientation={orientation}74 className={cn(fieldVariants({ orientation }), className)}75 {...props}76 />77 )78}7980// … truncated
What it pulls in
Other registry items
Files it writes
More from shadcn/ui
All 133 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn/ui | Components | Free | no deps | |
| alertalert | shadcn/ui | Components | Free | no deps | |
| alert-dialogalert-dialog | shadcn/ui | Components | Free | no deps | |
| aspect-ratioaspect-ratio | shadcn/ui | Components | Free | no deps | |
| avataravatar | shadcn/ui | Components | Free | no deps | |
| badgebadge | shadcn/ui | Components | Free | no deps | |
| breadcrumbbreadcrumb | shadcn/ui | Components | Free | no deps | |
| buttonbutton | shadcn/ui | Components | Free | no deps |
