MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / FormControl

Function FormControl

apps/ui/src/components/ui/form.tsx:113–130  ·  view source on GitHub ↗
({ ...props }: React.ComponentProps<typeof Slot.Root>)

Source from the content-addressed store, hash-verified

111}
112
113function FormControl({ ...props }: React.ComponentProps<typeof Slot.Root>) {
114 const { error, formItemId, formDescriptionId, formMessageId } =
115 useFormField();
116
117 return (
118 <Slot.Root
119 data-slot='form-control'
120 id={formItemId}
121 aria-describedby={
122 !error
123 ? `${formDescriptionId}`
124 : `${formDescriptionId} ${formMessageId}`
125 }
126 aria-invalid={!!error}
127 {...props}
128 />
129 );
130}
131
132function FormDescription({ className, ...props }: React.ComponentProps<"p">) {
133 const { formDescriptionId } = useFormField();

Callers

nothing calls this directly

Calls 1

useFormFieldFunction · 0.85

Tested by

no test coverage detected