Aurora Field
aurora-dinglebear-ai/aurora-fieldUnverifiedComponent
Field wrapper for labels, descriptions, required markers, disabled state, and validation errors.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/dinglebear-ai/aurora/main/aurora-field.jsonSource
1"use client"23import * as React from "react"4import { cn } from "@/lib/utils"5import { Label } from "./label"67export interface FieldProps extends React.HTMLAttributes<HTMLDivElement> {8 label?: React.ReactNode9 description?: React.ReactNode10 error?: React.ReactNode11 required?: boolean12 disabled?: boolean13 htmlFor?: string14 orientation?: "vertical" | "horizontal"15}1617function FieldGroup({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {18 return <div className={cn("flex flex-col gap-4", className)} {...props} />19}2021function FieldSet({ className, ...props }: React.FieldsetHTMLAttributes<HTMLFieldSetElement>) {22 return <fieldset className={cn("grid gap-3", className)} {...props} />23}2425function FieldLegend({ className, ...props }: React.HTMLAttributes<HTMLLegendElement>) {26 return (27 <legend28 data-slot="field-legend"29 className={cn("aurora-text-label mb-1 text-[var(--aurora-text-primary)]", className)}30 {...props}31 />32 )33}3435function FieldContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {36 return <div data-slot="field-content" className={cn("grid gap-1.5", className)} {...props} />37}3839function FieldTitle({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) {40 return (41 <span42 data-slot="field-title"43 className={cn("aurora-text-control text-[var(--aurora-text-primary)]", className)}44 {...props}45 />46 )47}4849function FieldDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>) {50 return (51 <p52 data-slot="field-description"53 className={cn("aurora-text-body-sm text-[var(--aurora-text-muted)]", className)}54 {...props}55 />56 )57}5859function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {60 return (61 <Label62 data-slot="field-label"63 className={cn("w-full justify-between text-[var(--aurora-text-primary)]", className)}64 {...props}65 />66 )67}6869function FieldError({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>) {70 return (71 <p72 role="alert"73 data-slot="field-error"74 className={cn("aurora-text-body-sm font-[var(--aurora-weight-ui)] text-[var(--aurora-error)]", className)}75 {...props}76 />77 )78}7980function Field({81 ref,82 className,83 children,84 label,85 description,86 error,87 required,88 disabled,89 htmlFor,90 orientation = "vertical",91 ...props92}: FieldProps & { ref?: React.Ref<HTMLDivElement> }) {93// … truncated
What it pulls in
Other registry items
Files it writes
More from aurora
All 176 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Aurora Accordionaurora-accordion | aurora | Components | Unverified | 2 deps | |
| Aurora Alert Dialogaurora-alert-dialog | aurora | Components | Unverified | 2 deps | |
| Aurora Aspect Ratioaurora-aspect-ratio | aurora | Components | Unverified | no deps | |
| Aurora Avataraurora-avatar | aurora | Components | Unverified | 1 dep | |
| Aurora Badgeaurora-badge | aurora | Components | Unverified | 2 deps | |
| Aurora Banneraurora-banner | aurora | Components | Unverified | 1 dep | |
| Aurora Breadcrumbaurora-breadcrumb | aurora | Components | Unverified | 2 deps | |
| Aurora Buttonaurora-button | aurora | Components | Unverified | 2 deps |
