4.2.0
CoreForm

Form API

Every prop of the 7 parts Form exports, plus the 1 symbol it exports alongside them, generated from the package manifest.

import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField } from '@oceanic-hub/brand-system'
Layer
core — shadcn-derived primitives.
Exports
Form · FormControl · FormDescription · FormField · FormItem · FormLabel · FormMessage · useFormField
Contract
packages/brand-system/src/components/form.contract.test-d.ts
Demos
4 on the Form page — rendered live, hydrated
Source
packages/brand-system/src/components/form.tsx

Generated from manifest/component-manifest.json, so it cannot drift from the source. For what Form is for, how it composes and what it looks like, see Form.

Form

Re-exported from react-hook-form. These are its props — this package adds none of its own. DOM attributes are accepted too and omitted here.

Prop

Type

FormControl

A wiring wrapper, not an element. It renders its single child through a Slot, forwarding that child's own props untouched and supplying the accessibility attributes the field needs — id, aria-describedby and aria-invalid, all read from the surrounding FormField. Wrap the control; do not style this.

FormDescription

A styled <p> with no API of its own. It takes that element's standard attributes — className, event handlers, ref — and nothing else.

FormField

Inherited from the primitive underneath — this package adds none of its own. DOM attributes are accepted too and omitted here.

Prop

Type

FormItem

A styled <div> with no API of its own. It takes that element's standard attributes — className, event handlers, ref — and nothing else.

FormLabel

Inherited from @radix-ui/react-label — this package adds none of its own. DOM attributes are accepted too and omitted here.

Prop

Type

FormMessage

A styled <p> with no API of its own. It takes that element's standard attributes — className, event handlers, ref — and nothing else.

useFormField

A React hook.Call it inside a component rendered under this module's provider; outside one it throws, which is the contract rather than a bug.

(): { invalid: boolean; isDirty: boolean; isTouched: boolean; isValidating: boolean; error?: import("react-hook-form").FieldError; id: string; name: string; formItemId: string; formDescriptionId: string; formMessageId: string; }

On this page