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: packages/docs/docs/api-reference/uiSchema.md
+45-1Lines changed: 45 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -485,7 +485,25 @@ render(
485
485
486
486
### emptyValue
487
487
488
-
The `ui:emptyValue` uiSchema directive provides the default value to use when an input for a field is empty
488
+
The `ui:emptyValue` uiSchema directive provides the default value to use when a field is empty. This applies whenever the field is blank, whether from initial render, a form reset, or the user clearing the input.
@@ -588,6 +606,28 @@ If you need to enable the default error display of a child in the hierarchy afte
588
606
589
607
This is useful when you have a custom field or widget that utilizes either the `rawErrors` or the `errorSchema` to manipulate and/or show the error(s) for the field/widget itself.
590
608
609
+
### initialValue
610
+
611
+
The `ui:initialValue` uiSchema directive pre-fills a field on initial render and after a form reset. It takes priority over `schema.default` but does not override user-provided `formData`. Useful for hidden fields that need a fixed value.
To change the input type (for example, `tel` or `email`) you can specify the `inputType` in the `ui:options` uiSchema directive.
@@ -682,6 +722,10 @@ The `ui:readonly` uiSchema directive will mark all child widgets from a given fi
682
722
683
723
> Note: If you're wondering about the difference between a `disabled` field and a `readonly` one: Marking a field as read-only will render it greyed out, but its text value will be selectable. Disabling it will prevent its value to be selected at all.
684
724
725
+
### required
726
+
727
+
The `ui:required` uiSchema directive overrides the schema's `required` status for a field. Setting `ui:required` to `true` shows the required indicator and produces a validation error if the field is left empty. Setting it to `false` hides the required indicator, but does not suppress schema-level validation. A `console.warn` is emitted when `ui:required` is `false` on a schema-required field without `ui:initialValue` or `ui:emptyValue` set.
728
+
685
729
### rows
686
730
687
731
You can set the initial height of a textarea widget by specifying `rows` option.
0 commit comments