Skip to content
Forms

Form

react-hook-form + zod integration.

Import

tsx
import { Form } from "@cronus-ui/ui";
bash
npx cronus-ui add form

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component FormDefault layout:inline style:form {
  label "Email"
  text "ada@cronus.dev"
}

page "/audit/form/default" type:custom {
  use FormDefault
}

API Reference

Generated from the component's exported types.

FormProps

Extends ComponentPropsWithoutRef<typeof FormProvider>

Skip FormProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

FormFieldProps

Extends ControllerProps<TFieldValues, TName>

Skip FormFieldProps props table
PropTypeDefaultDescription
name
string—Field path in the form values.
control
Control<TFieldValues>—RHF control instance.
render
(props) => ReactNode—Render-prop for the bound control.

FormItemProps

Extends HTMLAttributes<HTMLDivElement>

Skip FormItemProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

FormLabelProps

Extends ComponentPropsWithoutRef<typeof Label>

Skip FormLabelProps props table
PropTypeDefaultDescription
htmlFor
string—id of the labelled control.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

FormControlProps

Extends ComponentPropsWithoutRef<typeof Slot>

Skip FormControlProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

FormDescriptionProps

Extends HTMLAttributes<HTMLParagraphElement>

Skip FormDescriptionProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

FormMessageProps

Extends HTMLAttributes<HTMLParagraphElement>

Skip FormMessageProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.