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/advanced-customization/custom-templates.md
+49-5Lines changed: 49 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,16 +76,27 @@ render(
76
76
);
77
77
```
78
78
79
-
You also can provide your own field template to a uiSchema by specifying a `ui:ArrayFieldTemplate` property with your Component or a string value from the `Registry`.
79
+
You also can provide your own field template to a uiSchema by specifying a `ui:ArrayFieldTemplate` property with your Component :
Please see the [customArray.tsx sample](https://github.com/rjsf-team/react-jsonschema-form/blob/main/packages/playground/src/samples/customArray.tsx) from the [playground](https://rjsf-team.github.io/react-jsonschema-form/) for another example.
90
101
91
102
The following props are passed to each `ArrayFieldTemplate`:
@@ -163,16 +174,27 @@ render(
163
174
);
164
175
```
165
176
166
-
You also can provide your own template to a uiSchema by specifying a `ui:ArrayFieldDescriptionTemplate` property with your Component or a string value from the `Registry`.
177
+
You also can provide your own field template to a uiSchema by specifying a `ui:ArrayFieldDescriptionTemplate` property with your Component :
The following props are passed to each `ArrayFieldDescriptionTemplate`:
177
199
178
200
-`description`: The description of the array field being rendered.
@@ -615,13 +637,24 @@ render(
615
637
);
616
638
```
617
639
618
-
You also can provide your own field template to a uiSchema by specifying a `ui:FieldTemplate` property with your Component or a string value from the `Registry`.
640
+
You also can provide your own field template to a uiSchema by specifying a `ui:FieldTemplate` property with your Component :
619
641
620
642
```tsx
621
643
import { UiSchema } from'@rjsf/utils';
644
+
importFieldTemplatefrom'./FieldTemplate';
622
645
623
646
const uiSchema:UiSchema= {
624
-
'ui:FieldTemplate': CustomFieldTemplate,
647
+
'ui:FieldTemplate': FieldTemplate,
648
+
};
649
+
```
650
+
651
+
or a string value from the `Registry` :
652
+
653
+
```tsx
654
+
import { UiSchema } from'@rjsf/utils';
655
+
656
+
const uiSchema:UiSchema= {
657
+
'ui:FieldTemplate': 'CustomFieldTemplate',
625
658
};
626
659
```
627
660
@@ -693,16 +726,27 @@ render(
693
726
);
694
727
```
695
728
696
-
You also can provide your own field template to a uiSchema by specifying a `ui:ObjectFieldTemplate` property with your Component or a string value from the `Registry`.
729
+
You also can provide your own field template to a uiSchema by specifying a `ui:ObjectFieldTemplate` property with your Component :
Please see the [customObject.tsx sample](https://github.com/rjsf-team/react-jsonschema-form/blob/main/packages/playground/src/samples/customObject.tsx) from the [playground](https://rjsf-team.github.io/react-jsonschema-form/) for a better example.
707
751
708
752
The following props are passed to each `ObjectFieldTemplate` as defined by the `ObjectFieldTemplateProps` in `@rjsf/utils`:
0 commit comments