field
agentmesh/fieldFreeComponent
shadcn/ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by shadcn/ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://raw.githubusercontent.com/ombhanushaliii/agentmesh/main/example/ui/apps/v4/public/r/styles/base-vega/field.jsonSource
1"use client"23import { useMemo } from "react"4import { cva, type VariantProps } from "class-variance-authority"56import { cn } from "@/registry/base-vega/lib/utils"7import { Label } from "@/registry/base-vega/ui/label"8import { Separator } from "@/registry/base-vega/ui/separator"910function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {11 return (12 <fieldset13 data-slot="field-set"14 className={cn(15 "flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",16 className17 )}18 {...props}19 />20 )21}2223function FieldLegend({24 className,25 variant = "legend",26 ...props27}: React.ComponentProps<"legend"> & { variant?: "legend" | "label" }) {28 return (29 <legend30 data-slot="field-legend"31 data-variant={variant}32 className={cn(33 "mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base",34 className35 )}36 {...props}37 />38 )39}4041function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {42 return (43 <div44 data-slot="field-group"45 className={cn(46 "group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",47 className48 )}49 {...props}50 />51 )52}5354const fieldVariants = cva(55 "group/field flex w-full gap-3 data-[invalid=true]:text-destructive",56 {57 variants: {58 orientation: {59 vertical: "flex-col *:w-full [&>.sr-only]:w-auto",60 horizontal:61 "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",62 responsive:63 "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",64 },65 },66 defaultVariants: {67 orientation: "vertical",68 },69 }70)7172function Field({73 className,74 orientation = "vertical",75 ...props76}: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>) {77 return (78 <div79 role="group"80 data-slot="field"81 data-orientation={orientation}82 className={cn(fieldVariants({ orientation }), className)}83// … truncated
What it pulls in
Other registry items
Files it writes
More from shadcn/ui
All 201 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 |
