You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/docs/content/docs/react/customization.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,11 @@ title: Customization
3
3
description: The customization of the components is done by providing a `fieldConfig` to your schema fields. This allows you to customize the rendering of the field, add additional props, and more.
4
4
---
5
5
6
-
With zod, you can use the `superRefine` method to add a `fieldConfig` to your schema field. For more information, see the [Zod documentation](/docs/schema/zod).
6
+
With zod, you can use the `superRefine` method to add a `fieldConfig` to your schema field. For more information, see the [Zod documentation](/docs/schema-providers/zod).
7
7
8
-
With yup, you can use the `transform` method to add a `fieldConfig` to your schema field. For more information, see the [Yup documentation](/docs/schema/yup).
8
+
With yup, you can use the `transform` method to add a `fieldConfig` to your schema field. For more information, see the [Yup documentation](/docs/schema-providers/yup).
9
9
10
-
With joi, you can use the `meta` method to add a `fieldConfig` to your schema field. For more information, see the [Joi documentation](/docs/schema/joi).
10
+
With joi, you can use the `meta` method to add a `fieldConfig` to your schema field. For more information, see the [Joi documentation](/docs/schema-providers/joi).
You can use the `fieldConfig` function to set additional configuration for how a field should be rendered. This function is independent of the UI library you use so you can provide the FieldTypes that are supported by your UI library.
249
+
It's recommended to create your own `fieldConfig` function. Use the base `buildZodFieldConfig` from `@autoform/react` and extend it with your customizations to ensure full TypeScript support.
249
250
250
-
**Zod v3:**
251
+
> `ZodProvider` and `fieldConfig` from `@autoform/zod` are fully compatible with all Zod versions including v3, v4, and Zod Mini, allowing you to use them across any Zod version.
251
252
252
-
For Zod v3, it's recommended that you create your own fieldConfig function that uses the base `buildZodFieldConfig` function from `@autoform/react` and adds your own customizations. You apply this configuration using the `.superRefine()` method.
253
+
#### Zod v3
254
+
255
+
With Zod v3, you apply this configuration using the `.superRefine()` method.
With Zod v4, the method for applying `fieldConfig` has changed. You now use the `fieldConfig` function directly from `@autoform/zod/v4` and apply it using the `.register()` method provided by Zod v4.
295
+
#### Zod v4
284
296
297
+
With Zod v4, you apply this configuration using the `.check()` method.
Notice the use of the spread operator (`...`) before `fieldConfig` when calling `.register()`. This is necessary because `register` expects two arguments, and the `fieldConfig` function from `@autoform/zod/v4` returns a tuple `[key, value]`. Also note that you should import `ZodProvider` and `fieldConfig` from `@autoform/zod/v4` when using Zod v4.
349
+
#### Zod Mini
350
+
351
+
With Zod mini, you apply this configuration using the `.check()` method.
0 commit comments