form
ora-ui/formFreeComponent
ora-ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by ora-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ora-ui.com/r/form.jsonSource
1'use client';23import { Field as FieldPrimitive } from '@base-ui/react/field';4import { Fieldset as FieldsetPrimitive } from '@base-ui/react/fieldset';5import { Form as FormPrimitive } from '@base-ui/react/form';67import { cn } from '@/registry/lib/utils';89function Field({ className, ...props }: FieldPrimitive.Root.Props) {10 return (11 <FieldPrimitive.Root12 data-slot="field"13 className={cn('flex flex-col gap-1.5', className)}14 {...props}15 />16 );17}1819function FieldLabel({ className, ...props }: FieldPrimitive.Label.Props) {20 return (21 <FieldPrimitive.Label22 data-slot="field-label"23 className={cn(24 'text-sm font-medium text-primary data-invalid:text-(--destructive-secondary)',25 className26 )}27 {...props}28 />29 );30}3132function FieldControl({ className, ...props }: FieldPrimitive.Control.Props) {33 return <FieldPrimitive.Control data-slot="field-control" className={cn(className)} {...props} />;34}3536function FieldDescription({ className, ...props }: FieldPrimitive.Description.Props) {37 return (38 <FieldPrimitive.Description39 data-slot="field-description"40 className={cn('text-xs text-muted', className)}41 {...props}42 />43 );44}4546function FieldValidity(props: FieldPrimitive.Validity.Props) {47 return <FieldPrimitive.Validity data-slot="field-validity" {...props} />;48}4950function FieldError({ className, ...props }: FieldPrimitive.Error.Props) {51 return (52 <FieldPrimitive.Error53 data-slot="field-error"54 className={cn('text-xs text-(--destructive-secondary)', className)}55 {...props}56 />57 );58}5960function Form({ className, ...props }: FormPrimitive.Props) {61 return <FormPrimitive data-slot="form" className={cn(className)} {...props} />;62}6364function Fieldset({ className, ...props }: FieldsetPrimitive.Root.Props) {65 return (66 <FieldsetPrimitive.Root67 data-slot="fieldset"68 className={cn('flex flex-col gap-4 border-0 p-0 m-0', className)}69 {...props}70 />71 );72}7374function FieldsetLegend({ className, ...props }: FieldsetPrimitive.Legend.Props) {75 return (76 <FieldsetPrimitive.Legend77 data-slot="fieldset-legend"78 className={cn('text-sm font-medium text-primary', className)}79 {...props}80 />81 );82}8384export {85 Form,86 Field,87 FieldLabel,88 FieldControl,89 FieldDescription,90 FieldValidity,91 FieldError,92 Fieldset,93 FieldsetLegend,94};
What it pulls in
npm packages
Other registry items
Files it writes
More from ora-ui
All 31 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | ora-ui | Components | Free | 2 deps | |
| alert-dialogalert-dialog | ora-ui | Components | Free | 1 dep | |
| avataravatar | ora-ui | Components | Free | 1 dep | |
| avatar-groupavatar-group | ora-ui | Components | Free | no deps | |
| badgebadge | ora-ui | Components | Free | 2 deps | |
| buttonbutton | ora-ui | Components | Free | 2 deps | |
| button-groupbutton-group | ora-ui | Components | Free | 2 deps | |
| checkboxcheckbox | ora-ui | Components | Free | 3 deps |
