diff --git a/packages/docs/docusaurus.config.js b/packages/docs/docusaurus.config.js
index bcbd0cd2c3..e961d9ae71 100644
--- a/packages/docs/docusaurus.config.js
+++ b/packages/docs/docusaurus.config.js
@@ -4,6 +4,8 @@
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
+const currentProjectVersion = require('./package.json').version;
+
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'react-jsonschema-form',
@@ -44,9 +46,13 @@ const config = {
lastVersion: 'current',
versions: {
current: {
- label: 'v5',
+ label: `Current (v${currentProjectVersion})`,
path: '',
},
+ '5.24.10': {
+ label: 'v5',
+ path: 'version-5.24.10',
+ },
'4.2.3': {
label: 'v4',
path: 'version-4.2.3',
diff --git a/packages/docs/tsconfig.json b/packages/docs/tsconfig.json
index 6f4756980d..aea83c96d6 100644
--- a/packages/docs/tsconfig.json
+++ b/packages/docs/tsconfig.json
@@ -2,6 +2,7 @@
// This file is not used in compilation. It is here just for a nice editor experience.
"extends": "@tsconfig/docusaurus/tsconfig.json",
"compilerOptions": {
- "baseUrl": "."
+ "baseUrl": ".",
+ "resolveJsonModule": true
}
}
diff --git a/packages/docs/versioned_docs/version-5.24.10/00-introduction.mdx b/packages/docs/versioned_docs/version-5.24.10/00-introduction.mdx
new file mode 100644
index 0000000000..ec7b1078c8
--- /dev/null
+++ b/packages/docs/versioned_docs/version-5.24.10/00-introduction.mdx
@@ -0,0 +1,135 @@
+---
+id: intro
+title: Introduction
+slug: /
+---
+
+# react-jsonschema-form
+
+
+
+A simple [React](https://reactjs.org/) component capable of building HTML forms out of a [JSON schema](http://json-schema.org/).
+
+A [live playground](https://rjsf-team.github.io/react-jsonschema-form/) is hosted on GitHub Pages:
+
+
+
+
+
+## Philosophy
+
+react-jsonschema-form is meant to automatically generate a React form based on a [JSON Schema](http://json-schema.org/). If you want to generate a form for any data, sight unseen, simply given a JSON schema, react-jsonschema-form may be for you. If you have _a priori_ knowledge of your data and want a toolkit for generating forms for it, you might look elsewhere.
+
+react-jsonschema-form also comes with tools such as `uiSchema` and other form props to customize the look and feel of the form beyond the default themes.
+
+## Installation
+
+First install the dependencies from npm, along with a validator implementation (such as `@rjsf/validator-ajv8`):
+
+```bash
+$ npm install @rjsf/core @rjsf/utils @rjsf/validator-ajv8 --save
+```
+
+Then import the dependencies as follows:
+
+```ts
+import Form from '@rjsf/core';
+import validator from '@rjsf/validator-ajv8';
+```
+
+Our latest version requires React 16+.
+
+## Usage
+
+```tsx
+import Form from '@rjsf/core';
+import { RJSFSchema } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ title: 'Todo',
+ type: 'object',
+ required: ['title'],
+ properties: {
+ title: { type: 'string', title: 'Title', default: 'A new task' },
+ done: { type: 'boolean', title: 'Done?', default: false },
+ },
+};
+
+const log = (type) => console.log.bind(console, type);
+
+render(
+
,
+ document.getElementById('app')
+);
+```
+
+## Theming
+
+For more information on what themes we support, see [Using Themes](usage/themes).
+
+
+
+## License
+
+Apache 2
+
+## Credits
+
+
+
+
+
+
+
+ This project initially started as a mozilla-services project.
+
+
+## Who uses react-jsonschema-form?
+
+- ...
+
+Add your own company / organization by making a [pull request](https://github.com/rjsf-team/react-jsonschema-form/pulls).
diff --git a/packages/docs/versioned_docs/version-5.24.10/01-quickstart.md b/packages/docs/versioned_docs/version-5.24.10/01-quickstart.md
new file mode 100644
index 0000000000..e6c1050fe1
--- /dev/null
+++ b/packages/docs/versioned_docs/version-5.24.10/01-quickstart.md
@@ -0,0 +1,163 @@
+# Quickstart
+
+Let's walk through setup of a form after installing the dependency properly.
+NOTE: As of version 5, the `Form` now requires you to provide a `validator` implementation. We recommend the one from `@rjsf/validator-ajv8`.
+
+## Form schema
+
+First, specify a schema using the [JSON Schema specification](https://json-schema.org/). The below schema renders a single string field:
+
+```tsx
+import Form from '@rjsf/core';
+import { RJSFSchema } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ title: 'Test form',
+ type: 'string',
+};
+
+render(, document.getElementById('app'));
+```
+
+You can also render an object with multiple fields with the below schema:
+
+```tsx
+import Form from '@rjsf/core';
+import { RJSFSchema } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ title: 'Test form',
+ type: 'object',
+ properties: {
+ name: {
+ type: 'string',
+ },
+ age: {
+ type: 'number',
+ },
+ },
+};
+
+render(, document.getElementById('app'));
+```
+
+For more information and examples of JSON Schema properties that this library supports, see [Using JSON Schema](json-schema/single.md).
+
+## Form uiSchema
+
+The uiSchema is used to add more customization to the form's look and feel. Use the `classNames`
+attribute of the uiSchema to add a custom CSS class name to the form:
+
+```tsx
+import Form from '@rjsf/core';
+import { RJSFSchema, UiSchema } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ title: 'Test form',
+ type: 'string',
+};
+
+const uiSchema: UiSchema = {
+ 'ui:classNames': 'custom-css-class',
+};
+
+render(, document.getElementById('app'));
+```
+
+To customize object fields in the uiSchema, the structure of the
+uiSchema should be `{key: value}`, where `key` is the property key and `value` is an
+object with the uiSchema configuration for that particular property. For example:
+
+```tsx
+import Form from '@rjsf/core';
+import { RJSFSchema, UiSchema } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ title: 'Test form',
+ type: 'object',
+ properties: {
+ name: {
+ type: 'string',
+ },
+ age: {
+ type: 'number',
+ },
+ },
+};
+
+const uiSchema: UiSchema = {
+ name: {
+ 'ui:classNames': 'custom-class-name',
+ },
+ age: {
+ 'ui:classNames': 'custom-class-age',
+ },
+};
+
+render(, document.getElementById('app'));
+```
+
+## Form initialization
+
+Often you'll want to prefill a form with existing data; this is done by passing a `formData` prop object matching the schema:
+
+```tsx
+import Form from '@rjsf/core';
+import { RJSFSchema } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'object',
+ properties: {
+ title: {
+ type: 'string',
+ },
+ done: {
+ type: 'boolean',
+ },
+ },
+};
+
+const formData = {
+ title: 'First task',
+ done: true,
+};
+
+render(, document.getElementById('app'));
+```
+
+> Note: If your form has a single field, pass a single value to `formData`. ex: `formData="Charlie"`
+
+> WARNING: If you have situations where your parent component can re-render, make sure you listen to the `onChange` event and update the data you pass to the `formData` attribute.
+
+### Form event handlers
+
+You can use event handlers such as `onChange`, `onError`, `onSubmit`, `onFocus`, and `onBlur` on the `` component; see the [Form Props Reference](./api-reference/form-props.md) for more details.
+
+### Controlled component
+
+By default, `` is an [uncontrolled component](https://reactjs.org/docs/uncontrolled-components.html). To make it a controlled component, use the
+`onChange` and `formData` props as in the below example:
+
+```tsx
+import Form from '@rjsf/core';
+import validator from '@rjsf/validator-ajv8';
+
+const App = () => {
+ const [formData, setFormData] = React.useState(null);
+ return (
+ ` | `` | `` |
+| **Per-Field Example** | `"ui:field": MyCustomField` | `"ui:ArrayFieldTemplate": MyArrayTemplate` | `"ui:widget":MyCustomWidget` |
+| **Documentation** | [Custom Fields](custom-widgets-fields.md) | See documentation below | [Custom Widgets](custom-widgets-fields.md) |
+
+In version 5, all existing `templates` were consolidated into a new `TemplatesType` interface that is provided as part of the `Registry`.
+They can also be overloaded globally on the `Form` via the `templates` prop as well as globally or per-field through the `uiSchema`.
+Further, many new templates were added or repurposed from existing `widgets` and `fields` in an effort to simplify the effort needed by theme authors to build new and/or maintain current themes.
+These new templates can also be overridden by individual users to customize the specific needs of their application.
+A special category of templates, `ButtonTemplates`, were also added to support the easy replacement of the `Submit` button on the form, the `Add` and `Remove` buttons associated with `additionalProperties` on objects and elements of arrays, as well as the `Move up` and `Move down` buttons used for reordering arrays.
+This category, unlike the others, can only be overridden globally via the `templates` prop on `Form`.
+
+Below is the table that lists all the `templates`, their props interface, their `uiSchema` name and from where they originated in the previous version of RJSF:
+
+| Template\* | Props Type | UiSchema name | Origin |
+| ----------------------------------------------------------------- | ----------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| [ArrayFieldTemplate](#arrayfieldtemplate) | ArrayFieldTemplateProps | ui:ArrayFieldTemplate | Formerly `Form.ArrayFieldTemplate` or `Registry.ArrayFieldTemplate` |
+| [ArrayFieldDescriptionTemplate\*](#arrayfielddescriptiontemplate) | ArrayFieldDescriptionProps | ui:ArrayFieldDescriptionTemplate | Formerly part of `@rjsf/core` ArrayField, refactored as a template, used in all `ArrayFieldTemplate` implementations |
+| [ArrayFieldItemTemplate\*](#arrayfielditemtemplate) | ArrayFieldTemplateItemType | ui:ArrayFieldItemTemplate | Formerly an internal class for `ArrayFieldTemplate`s in all themes, refactored as a template in each theme, used in all `ArrayFieldTemplate` implementations |
+| [ArrayFieldTitleTemplate\*](#arrayfieldtitletemplate) | ArrayFieldTitleProps | ui:ArrayFieldTitleTemplate | Formerly part of `@rjsf/core` ArrayField, refactored as a template, used in all `ArrayFieldTemplate` implementations. |
+| [BaseInputTemplate\*](#baseinputtemplate) | WidgetProps | ui:BaseInputTemplate | Formerly a `widget` in `@rjsf.core` moved to `templates` and newly implemented in each theme to maximize code reuse. |
+| [DescriptionFieldTemplate\*](#descriptionfieldtemplate) | DescriptionFieldProps | ui:DescriptionFieldTemplate | Formerly a `field` in `@rjsf.core` moved to `templates` with the `Template` suffix. Previously implemented in each theme. |
+| [ErrorListTemplate\*](#errorlisttemplate) | ErrorListProps | ui:ErrorListTemplate | Formerly `Form.ErrorList` moved to `templates` with the `Templates` suffix. Previously implemented in each theme. |
+| [FieldErrorTemplate\*](#fielderrortemplate) | FieldErrorProps | ui:FieldErrorTemplate | Formerly internal `ErrorList` component accessible only to `SchemaField` |
+| [FieldHelpTemplate\*](#fieldhelptemplate) | FieldHelpProps | ui:FieldHelpTemplate | Formerly internal `Help` component accessible only to `SchemaField` |
+| [FieldTemplate](#fieldtemplate) | FieldTemplateProps | ui:FieldTemplate | Formerly `Form.FieldTemplate` or `Registry.FieldTemplate` |
+| [ObjectFieldTemplate](#objectfieldtemplate) | ObjectFieldTemplateProps | ui:ObjectFieldTemplate | Formerly `Form.ObjectFieldTemplate` or `Registry.ObjectFieldTemplate` |
+| [TitleFieldTemplate\*](#titlefieldtemplate) | TitleFieldProps | ui:TitleFieldTemplate | Formerly a `field` in `@rjsf.core` moved to `templates` with the `Template` suffix. Previously implemented in each theme. |
+| [UnsupportedFieldTemplate\*](#unsupportedfieldtemplate) | UnsupportedFieldProps | ui:UnsupportedFieldTemplate | Formerly a `field` in `@rjsf.core` moved to `templates` with the `Template` suffix. |
+| [WrapIfAdditionalTemplate\*](#wrapifadditionaltemplate) | WrapIfAdditionalTemplateProps | ui:WrapIfAdditionalTemplate | Formerly an internal component in `@rjsf.core`. Previously implemented in most themes. |
+| [ButtonTemplates.AddButton\*](#addbutton) | IconButtonProps | n/a | Formerly an internal implementation in each theme |
+| [ButtonTemplates.MoveDownButton\*](#movedownbutton) | IconButtonProps | n/a | Formerly an internal implementation in each theme |
+| [ButtonTemplates.MoveUpButton\*](#moveupbutton) | IconButtonProps | n/a | Formerly an internal implementation in each theme |
+| [ButtonTemplates.RemoveButton\*](#removebutton) | IconButtonProps | n/a | Formerly an internal implementation in each theme |
+| [ButtonTemplates.SubmitButton\*](#submitbutton) | SubmitButtonProps | n/a | Formerly a `field` in each theme move to `templates.ButtonTemplates` |
+
+\* indicates a new template in version 5
+
+## ArrayFieldTemplate
+
+You can use an `ArrayFieldTemplate` to customize how your arrays are rendered.
+This allows you to customize your array, and each element in the array.
+If you only want to customize how the array's title, description or how the array items are presented, you may want to consider providing your own [ArrayFieldDescriptionTemplate](#arrayfielddescriptiontemplate), [ArrayFieldItemTemplate](#arrayfielditemtemplate) and/or [ArrayFieldTitleTemplate](#arrayfieldtitletemplate) instead.
+You can also customize arrays by specifying a widget in the relevant `ui:widget` schema, more details over on [Custom Widgets](../json-schema/arrays.md#custom-widgets).
+
+```tsx
+import { ArrayFieldTemplateProps, RJSFSchema } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'array',
+ items: {
+ type: 'string',
+ },
+};
+
+function ArrayFieldTemplate(props: ArrayFieldTemplateProps) {
+ return (
+
+ );
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+You also can provide your own field template to a uiSchema by specifying a `ui:ArrayFieldTemplate` property.
+
+```tsx
+import { UiSchema } from '@rjsf/utils';
+
+const uiSchema: UiSchema = {
+ 'ui:ArrayFieldTemplate': ArrayFieldTemplate,
+};
+```
+
+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.
+
+The following props are passed to each `ArrayFieldTemplate`:
+
+- `canAdd`: A boolean value stating whether new elements can be added to the array.
+- `className`: The className string.
+- `disabled`: A boolean value stating if the array is disabled.
+- `idSchema`: An object containing the id for this object & ids for its properties
+- `items`: An array of objects representing the items in the array. Each of the items represent a child with properties described below.
+- `onAddClick: (event?) => void`: A function that adds a new item to the array.
+- `readonly`: A boolean value stating if the array is read-only.
+- `required`: A boolean value stating if the array is required.
+- `hideError`: A boolean value stating if the field is hiding its errors.
+- `schema`: The schema object for this array.
+- `uiSchema`: The uiSchema object for this array field.
+- `title`: A string value containing the title for the array.
+- `formContext`: The `formContext` object that you passed to Form.
+- `formData`: The formData for this array.
+- `errorSchema`: The optional validation errors for the array field and the items within it, in the form of an `ErrorSchema`
+- `rawErrors`: An array of strings listing all generated error messages from encountered errors for this widget
+- `registry`: The `registry` object.
+
+The following props are part of each element in `items`:
+
+- `children`: The html for the item's content.
+- `className`: The className string.
+- `disabled`: A boolean value stating if the array item is disabled.
+- `hasCopy`: A boolean value stating whether the array item can be copied.
+- `hasMoveDown`: A boolean value stating whether the array item can be moved down.
+- `hasMoveUp`: A boolean value stating whether the array item can be moved up.
+- `hasRemove`: A boolean value stating whether the array item can be removed.
+- `hasToolbar`: A boolean value stating whether the array item has a toolbar.
+- `index`: A number stating the index the array item occurs in `items`.
+- `key`: A stable, unique key for the array item.
+- `onAddIndexClick: (index) => (event?) => void`: Returns a function that adds a new item at `index`.
+- `onDropIndexClick: (index) => (event?) => void`: Returns a function that removes the item at `index`.
+- `onReorderClick: (index, newIndex) => (event?) => void`: Returns a function that swaps the items at `index` with `newIndex`.
+- `readonly`: A boolean value stating if the array item is read-only.
+- `uiSchema`: The uiSchema object for this array item.
+- `registry`: The `registry` object.
+
+> Note: Array and object field templates are always rendered inside the FieldTemplate. To fully customize an array field template, you may need to specify both `ui:FieldTemplate` and `ui:ArrayFieldTemplate`.
+
+## ArrayFieldDescriptionTemplate
+
+The out-of-the-box version of this template will render the `DescriptionFieldTemplate` with a generated id, if there is a `description` otherwise nothing is rendered.
+If you want different behavior for the rendering of the description of an array field, you can customize this template.
+If you want a different behavior for the rendering of ALL descriptions in the `Form`, see [DescriptionFieldTemplate](#descriptionfieldtemplate)
+
+```tsx
+import { ArrayFieldDescriptionProps, RJSFSchema, descriptionId } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'array',
+ items: {
+ type: 'string',
+ },
+};
+
+function ArrayFieldDescriptionTemplate(props: ArrayFieldDescriptionProps) {
+ const { description, idSchema } = props;
+ const id = descriptionId(idSchema);
+ return (
+
+ Description
+ {description}
+
+ );
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+You also can provide your own template to a uiSchema by specifying a `ui:ArrayFieldDescriptionTemplate` property.
+
+```tsx
+import { UiSchema } from '@rjsf/utils';
+
+const uiSchema: UiSchema = {
+ 'ui:ArrayFieldDescriptionTemplate': ArrayFieldDescriptionTemplate,
+};
+```
+
+The following props are passed to each `ArrayFieldDescriptionTemplate`:
+
+- `description`: The description of the array field being rendered.
+- `idSchema`: The idSchema of the array field in the hierarchy.
+- `schema`: The schema object for this array field.
+- `uiSchema`: The uiSchema object for this array field.
+- `registry`: The `registry` object.
+
+## ArrayFieldItemTemplate
+
+The `ArrayFieldItemTemplate` is used to render the representation of a single item in an array.
+All of the `ArrayFieldTemplate` implementations in all themes get this template from the `registry` in order to render array fields items.
+Each theme has an implementation of the `ArrayFieldItemTemplate` to render an array field item in a manner best suited to the theme.
+If you want to change how an array field item is rendered you can customize this template (for instance to remove the move up/down and remove buttons).
+
+```tsx
+import { ArrayFieldTemplateItemType, RJSFSchema } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'array',
+ items: {
+ type: 'string',
+ },
+};
+
+function ArrayFieldItemTemplate(props: ArrayFieldTemplateItemType) {
+ const { children, className } = props;
+ return
{children}
;
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+The following props are passed to each `ArrayFieldItemTemplate`:
+
+- `children`: The html for the item's content.
+- `className`: The className string.
+- `disabled`: A boolean value stating if the array item is disabled.
+- `canAdd`: A boolean value stating whether new items can be added to the array.
+- `hasCopy`: A boolean value stating whether the array item can be copied.
+- `hasMoveDown`: A boolean value stating whether the array item can be moved down.
+- `hasMoveUp`: A boolean value stating whether the array item can be moved up.
+- `hasRemove`: A boolean value stating whether the array item can be removed.
+- `hasToolbar`: A boolean value stating whether the array item has a toolbar.
+- `index`: A number stating the index the array item occurs in `items`.
+- `totalItems`: A number stating the total number `items` in the array.
+- `key`: A stable, unique key for the array item.
+- `onAddIndexClick: (index) => (event?) => void`: Returns a function that adds a new item at `index`.
+- `onCopyIndexClick: (index) => (event?) => void`: Returns a function that copies the item at `index` into the position at `index + 1`
+- `onDropIndexClick: (index) => (event?) => void`: Returns a function that removes the item at `index`.
+- `onReorderClick: (index, newIndex) => (event?) => void`: Returns a function that swaps the items at `index` with `newIndex`.
+- `readonly`: A boolean value stating if the array item is read-only.
+- `schema`: The schema object for this array item.
+- `uiSchema`: The uiSchema object for this array item.
+- `registry`: The `registry` object.
+
+## ArrayFieldTitleTemplate
+
+The out-of-the-box version of this template will render the `TitleFieldTemplate` with a generated id, if there is a `title` otherwise nothing is rendered.
+If you want a different behavior for the rendering of the title of an array field, you can customize this template.
+If you want a different behavior for the rendering of ALL titles in the `Form`, see [TitleFieldTemplate](#titlefieldtemplate)
+
+```tsx
+import { ArrayFieldTitleTemplateProps, RJSFSchema, titleId } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'array',
+ items: {
+ type: 'string',
+ },
+};
+
+function ArrayFieldTitleTemplate(props: ArrayFieldTitleProps) {
+ const { title, idSchema } = props;
+ const id = titleId(idSchema);
+ return
{title}
;
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+You also can provide your own template to a uiSchema by specifying a `ui:ArrayFieldDescriptionTemplate` property.
+
+```tsx
+import { UiSchema } from '@rjsf/utils';
+
+const uiSchema: UiSchema = {
+ 'ui:ArrayFieldTitleTemplate': ArrayFieldTitleTemplate,
+};
+```
+
+The following props are passed to each `ArrayFieldTitleTemplate`:
+
+- `title`: The title of the array field being rendered.
+- `idSchema`: The idSchema of the array field in the hierarchy.
+- `schema`: The schema object for this array field.
+- `uiSchema`: The uiSchema object for this array field.
+- `required`: A boolean value stating if the field is required
+- `registry`: The `registry` object.
+
+## BaseInputTemplate
+
+The `BaseInputTemplate` is the template to use to render the basic `` component for a theme.
+It is used as the template for rendering many of the `` based widgets that differ by `type` and callbacks only.
+For example, the `TextWidget` implementation in `core` is simply a wrapper around `BaseInputTemplate` that it gets from the `registry`.
+Additionally, each theme implements its own version of `BaseInputTemplate` without needing to provide a different implementation of `TextWidget`.
+
+If you desire a different implementation for the `` based widgets, you can customize this template.
+For instance, say you have a `CustomTextInput` component that you want to integrate:
+
+```tsx
+import { ChangeEvent, FocusEvent } from 'react';
+import { getInputProps, RJSFSchema, BaseInputTemplateProps } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+import CustomTextInput from '../CustomTextInput';
+
+const schema: RJSFSchema = {
+ type: 'string',
+ title: 'My input',
+ description: 'input description',
+};
+
+function BaseInputTemplate(props: BaseInputTemplateProps) {
+ const {
+ schema,
+ id,
+ options,
+ label,
+ value,
+ type,
+ placeholder,
+ required,
+ disabled,
+ readonly,
+ autofocus,
+ onChange,
+ onChangeOverride,
+ onBlur,
+ onFocus,
+ rawErrors,
+ hideError,
+ uiSchema,
+ registry,
+ formContext,
+ ...rest
+ } = props;
+ const onTextChange = ({ target: { value: val } }: ChangeEvent) => {
+ // Use the options.emptyValue if it is specified and newVal is also an empty string
+ onChange(val === '' ? options.emptyValue || '' : val);
+ };
+ const onTextBlur = ({ target: { value: val } }: FocusEvent) => onBlur(id, val);
+ const onTextFocus = ({ target: { value: val } }: FocusEvent) => onFocus(id, val);
+
+ const inputProps = { ...rest, ...getInputProps(schema, type, options) };
+ const hasError = rawErrors.length > 0 && !hideError;
+
+ return (
+
+ );
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+### Wrapping BaseInputTemplate to customize it
+
+Sometimes you just need to pass some additional properties to the existing `BaseInputTemplate`.
+The way to do this varies based upon whether you are using `core` or some other theme (such as `mui`):
+
+```tsx
+import { BaseInputTemplateProps } from '@rjsf/utils';
+import { getDefaultRegistry } from '@rjsf/core';
+import { Templates } from '@rjsf/mui';
+
+const {
+ templates: { BaseInputTemplate },
+} = getDefaultRegistry(); // To get templates from core
+// const { BaseInputTemplate } = Templates; // To get templates from a theme do this
+
+function MyBaseInputTemplate(props: BaseInputTemplateProps) {
+ const customProps = {};
+ // get your custom props from where you need to
+ return ;
+}
+```
+
+The following props are passed to the `BaseInputTemplate`:
+
+- `id`: The generated id for this widget;
+- `schema`: The JSONSchema subschema object for this widget;
+- `uiSchema`: The uiSchema for this widget;
+- `value`: The current value for this widget;
+- `placeholder`: The placeholder for the widget, if any;
+- `required`: The required status of this widget;
+- `disabled`: A boolean value stating if the widget is disabled;
+- `hideError`: A boolean value stating if the widget is hiding its errors.
+- `readonly`: A boolean value stating if the widget is read-only;
+- `autofocus`: A boolean value stating if the widget should autofocus;
+- `label`: The computed label for this widget, as a string
+- `multiple`: A boolean value stating if the widget can accept multiple values;
+- `onChange`: The value change event handler; call it with the new value every time it changes;
+- `onChangeOverride`: A `BaseInputTemplate` implements a default `onChange` handler that it passes to the HTML input component to handle the `ChangeEvent`. Sometimes a widget may need to handle the `ChangeEvent` using custom logic. If that is the case, that widget should provide its own handler via this prop;
+- `onKeyChange`: The key change event handler (only called for fields with `additionalProperties`); pass the new value every time it changes;
+- `onBlur`: The input blur event handler; call it with the widget id and value;
+- `onFocus`: The input focus event handler; call it with the widget id and value;
+- `options`: A map of options passed as a prop to the component (see [Custom widget options](./custom-widgets-fields.md#custom-widget-options)).
+- `options.enumOptions`: For enum fields, this property contains the list of options for the enum as an array of { label, value } objects. If the enum is defined using the oneOf/anyOf syntax, the entire schema object for each option is appended onto the { schema, label, value } object.
+- `formContext`: The `formContext` object that you passed to `Form`.
+- `rawErrors`: An array of strings listing all generated error messages from encountered errors for this widget.
+- `registry`: The `registry` object
+
+## DescriptionFieldTemplate
+
+Each theme implements a `DescriptionFieldTemplate` used to render the description of a field.
+If you want to customize how descriptions are rendered you can.
+
+```tsx
+import { DescriptionFieldProps, RJSFSchema } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'string',
+ title: 'My input',
+ description: 'input description',
+};
+
+function DescriptionFieldTemplate(props: DescriptionFieldProps) {
+ const { description, id } = props;
+ return (
+
+ Description
+ {description}
+
+ );
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+The following props are passed to the `DescriptionFieldTemplate`:
+
+- `description`: The description of the field being rendered.
+- `id`: The id of the field in the hierarchy.
+- `schema`: The schema object for the field.
+- `uiSchema`: The uiSchema object for the field.
+- `registry`: The `registry` object.
+
+## ErrorListTemplate
+
+The `ErrorListTemplate` is the template that renders the all the errors associated with the fields in the `Form`, at the top.
+Each theme implements a `ErrorListTemplate` used to render its errors using components for the theme's toolkit.
+If you want to customize how all the errors are rendered you can.
+
+```tsx
+import { ErrorListProps, RJSFValidationError, RJSFSchema } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'string',
+ title: 'My input',
+ description: 'input description',
+};
+
+function ErrorListTemplate(props: ErrorListProps) {
+ const { errors } = props;
+ return (
+
+ Errors
+
+
+ );
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+The following props are passed to the `ErrorListTemplate`:
+
+- `schema`: The schema that was passed to `Form`
+- `uiSchema`: The uiSchema that was passed to `Form`
+- `formContext`: The `formContext` object that you passed to `Form`.
+- `errors`: An array of all errors in this `Form`.
+- `errorSchema`: The `ErrorSchema` constructed by `Form`
+
+## FieldErrorTemplate
+
+The `FieldErrorTemplate` is the template that renders all the errors associated a single field.
+If you want to customize how the errors are rendered you can.
+
+```tsx
+import { FieldErrorProps, RJSFSchema } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'string',
+ title: 'My input',
+ description: 'input description',
+};
+
+function FieldErrorTemplate(props: FieldErrorProps) {
+ const { errors } = props;
+ return (
+
+ Errors
+
+
+ );
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+The following props are passed to the `FieldErrorTemplate`:
+
+- `schema`: The schema for the field
+- `uiSchema`: The uiSchema for the field
+- `idSchema`: An object containing the id for this field & ids for its properties.
+- `errors`: An array of all errors for this field
+- `errorSchema`: The `ErrorSchema` for this field
+- `registry`: The `Registry` object
+
+## FieldHelpTemplate
+
+The `FieldHelpTemplate` is the template that renders the help associated a single field.
+If you want to customize how the help is rendered you can.
+
+```tsx
+import { FieldHelpProps, RJSFSchema, helpId } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'string',
+ title: 'My input',
+ description: 'input description',
+};
+
+function FieldHelpTemplate(props: FieldHelpProps) {
+ const { help, idSchema } = props;
+ const id = helpId(idSchema);
+ return ;
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+The following props are passed to the `FieldHelpTemplate`:
+
+- `schema`: The schema for the field
+- `uiSchema`: The uiSchema for the field
+- `idSchema`: An object containing the id for this field & ids for its properties.
+- `help`: The help information to be rendered
+- `registry`: The `Registry` object
+
+## FieldTemplate
+
+To take control over the inner organization of each field (each form row), you can define a _field template_ for your form.
+
+A field template is basically a React stateless component being passed field-related props, allowing you to structure your form row as you like.
+
+```tsx
+import { FieldTemplateProps, RJSFSchema } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'string',
+};
+
+function CustomFieldTemplate(props: FieldTemplateProps) {
+ const { id, classNames, style, label, help, required, description, errors, children } = props;
+ return (
+
+ );
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+You also can provide your own field template to a uiSchema by specifying a `ui:FieldTemplate` property.
+
+```tsx
+import { UiSchema } from '@rjsf/utils';
+
+const uiSchema: UiSchema = {
+ 'ui:FieldTemplate': CustomFieldTemplate,
+};
+```
+
+If you want to handle the rendering of each element yourself, you can use the props `rawHelp`, `rawDescription` and `rawErrors`.
+
+The following props are passed to a custom field template component:
+
+- `id`: The id of the field in the hierarchy. You can use it to render a label targeting the wrapped widget.
+- `classNames`: A string containing the base Bootstrap CSS classes, merged with any [custom ones](../api-reference/uiSchema.md#classnames) defined in your uiSchema.
+- `style`: An object containing the `StyleHTMLAttributes` defined in the `uiSchema`.
+- `label`: The computed label for this field, as a string.
+- `description`: A component instance rendering the field description, if one is defined (this will use any [custom `DescriptionFieldTemplate`](#descriptionfieldtemplate) defined in the `templates` passed to the `Form`).
+- `rawDescription`: A string containing any `ui:description` uiSchema directive defined.
+- `children`: The field or widget component instance for this field row.
+- `errors`: A component instance listing any encountered errors for this field.
+- `rawErrors`: An array of strings listing all generated error messages from encountered errors for this field.
+- `help`: A component instance rendering any `ui:help` uiSchema directive defined.
+- `rawHelp`: A string containing any `ui:help` uiSchema directive defined. **NOTE:** `rawHelp` will be `undefined` if passed `ui:help` is a React component instead of a string.
+- `hidden`: A boolean value stating if the field should be hidden.
+- `required`: A boolean value stating if the field is required.
+- `readonly`: A boolean value stating if the field is read-only.
+- `hideError`: A boolean value stating if the field is hiding its errors
+- `disabled`: A boolean value stating if the field is disabled.
+- `displayLabel`: A boolean value stating if the label should be rendered or not. This is useful for nested fields in arrays where you don't want to clutter the UI.
+- `schema`: The schema object for this field.
+- `uiSchema`: The uiSchema object for this field.
+- `onChange`: The value change event handler; Can be called with a new value to change the value for this field.
+- `formContext`: The `formContext` object that you passed to `Form`.
+- `formData`: The formData for this field.
+- `registry`: The `registry` object.
+
+> Note: you can only define a single global field template for a form, but you can set individual field templates per property using `"ui:FieldTemplate"`.
+
+## ObjectFieldTemplate
+
+```tsx
+import { ObjectFieldTemplateProps, RJSFSchema } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'object',
+ title: 'Object title',
+ description: 'Object description',
+ properties: {
+ name: {
+ type: 'string',
+ },
+ age: {
+ type: 'number',
+ },
+ },
+};
+
+function ObjectFieldTemplate(props: ObjectFieldTemplateProps) {
+ return (
+
+ );
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+You also can provide your own field template to a uiSchema by specifying a `ui:ObjectFieldTemplate` property.
+
+```tsx
+import { UiSchema } from '@rjsf/utils';
+
+const uiSchema: UiSchema = {
+ 'ui:ObjectFieldTemplate': ObjectFieldTemplate,
+};
+```
+
+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.
+
+The following props are passed to each `ObjectFieldTemplate` as defined by the `ObjectFieldTemplateProps` in `@rjsf/utils`:
+
+- `title`: A string value containing the title for the object.
+- `description`: A string value containing the description for the object.
+- `disabled`: A boolean value stating if the object is disabled.
+- `properties`: An array of object representing the properties in the object. Each of the properties represent a child with properties described below.
+- `onAddClick: (schema: RJSFSchema) => () => void`: Returns a function that adds a new property to the object (to be used with additionalProperties)
+- `readonly`: A boolean value stating if the object is read-only.
+- `required`: A boolean value stating if the object is required.
+- `hideError`: A boolean value stating if the field is hiding its errors.
+- `schema`: The schema object for this object.
+- `uiSchema`: The uiSchema object for this object field.
+- `idSchema`: An object containing the id for this object & ids for its properties.
+- `errorSchema`: The optional validation errors in the form of an `ErrorSchema`
+- `formData`: The form data for the object.
+- `formContext`: The `formContext` object that you passed to Form.
+- `registry`: The `registry` object.
+
+The following props are part of each element in `properties`:
+
+- `content`: The html for the property's content.
+- `name`: A string representing the property name.
+- `disabled`: A boolean value stating if the object property is disabled.
+- `readonly`: A boolean value stating if the property is read-only.
+- `hidden`: A boolean value stating if the property should be hidden.
+
+> Note: Array and object field templates are always rendered inside the FieldTemplate. To fully customize an object field template, you may need to specify both `ui:FieldTemplate` and `ui:ObjectFieldTemplate`.
+
+## TitleFieldTemplate
+
+Each theme implements a `TitleFieldTemplate` used to render the title of a field.
+If you want to customize how titles are rendered you can.
+
+```tsx
+import { RJSFSchema, TitleFieldProps } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'string',
+ title: 'My input',
+ description: 'input description',
+};
+
+function TitleFieldTemplate(props: TitleFieldProps) {
+ const { id, required, title } = props;
+ return (
+
+ {title}
+ {required && *}
+
+ );
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+The following props are passed to each `TitleFieldTemplate`:
+
+- `id`: The id of the field in the hierarchy.
+- `title`: The title of the field being rendered.
+- `schema`: The schema object for the field.
+- `uiSchema`: The uiSchema object for the field.
+- `required`: A boolean value stating if the field is required
+- `registry`: The `registry` object.
+
+## UnsupportedFieldTemplate
+
+The `UnsupportedField` component is used to render a field in the schema is one that is not supported by react-jsonschema-form.
+If you want to customize how an unsupported field is rendered (perhaps for localization purposes) you can.
+
+```tsx
+import { RJSFSchema, UnsupportedFieldProps } from '@rjsf/utils';
+import { FormattedMessage } from 'react-intl';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'invalid',
+};
+
+function UnsupportedFieldTemplate(props: UnsupportedFieldProps) {
+ const { schema, reason } = props;
+ return (
+
+
+
{JSON.stringify(schema, null, 2)}
+
+ );
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+The following props are passed to each `UnsupportedFieldTemplate`:
+
+- `schema`: The schema object for this unsupported field.
+- `idSchema`: An object containing the id for this unsupported field.
+- `reason`: The reason why the schema field has an unsupported type.
+- `registry`: The `registry` object.
+
+## WrapIfAdditionalTemplate
+
+The `WrapIfAdditionalTemplate` is used by the `FieldTemplate` to conditionally render additional controls if `additionalProperties` is present in the schema.
+You may customize `WrapIfAdditionalTemplate` if you wish to change the layout or behavior of user-controlled `additionalProperties`.
+
+```tsx
+import { RJSFSchema, WrapIfAdditionalTemplateProps } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'object',
+ additionalProperties: true,
+};
+
+function WrapIfAdditionalTemplate(props: WrapIfAdditionalTemplateProps) {
+ const { id, label, onKeyChange, onDropPropertyClick, schema, children, uiSchema, registry, classNames, style } =
+ props;
+ const { RemoveButton } = registry.templates.ButtonTemplates;
+ const additional = ADDITIONAL_PROPERTY_FLAG in schema;
+
+ if (!additional) {
+ return
{children}
;
+ }
+
+ return (
+
+
+
+
{children}
+
+
+ );
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+The following props are passed to the `WrapIfAdditionalTemplate`:
+
+- `children`: The children of the component, typically specified by the `FieldTemplate`.
+
+- `id`: The id of the field in the hierarchy. You can use it to render a label targeting the wrapped widget.
+- `classNames`: A string containing the base Bootstrap CSS classes, merged with any [custom ones](../api-reference/uiSchema.md#classnames) defined in your uiSchema.
+- `style`: An object containing the `StyleHTMLAttributes` defined in the `uiSchema`.
+- `label`: The computed label for this field, as a string.
+- `required`: A boolean value stating if the field is required.
+- `readonly`: A boolean value stating if the field is read-only.
+- `disabled`: A boolean value stating if the field is disabled.
+- `schema`: The schema object for this field.
+- `uiSchema`: The uiSchema object for this field.
+- `onKeyChange`: A function that, when called, changes the current property key to the specified value
+- `onDropPropertyClick`: A function that, when called, removes the key from the formData.
+
+## ButtonTemplates
+
+There are several buttons that are potentially rendered in the `Form`.
+Each of these buttons have been customized in the themes, and can be customized by you as well.
+All but one of these buttons (i.e. the `SubmitButton`) are rendered currently as icons with title text for a description.
+
+Each button template (except for the `SubmitButton`) accepts, as props, the standard [HTML button attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button) along with the following:
+
+- `iconType`: An alternative specification for the type of the icon button.
+- `icon`: The name representation or actual react element implementation for the icon.
+- `uiSchema`: The uiSchema object for this field.
+- `registry`: The `registry` object.
+
+### AddButton
+
+The `AddButton` is used to render an add action on a `Form` for both a new `additionalProperties` element for an object or a new element in an array.
+You can customize the `AddButton` to render something other than the icon button that is provided by a theme as follows:
+
+```tsx
+import React from 'react';
+import { IconButtonProps, RJSFSchema } from '@rjsf/utils';
+import { FormattedMessage } from 'react-intl';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'string',
+};
+
+function AddButton(props: IconButtonProps) {
+ const { icon, iconType, ...btnProps } = props;
+ return (
+
+ );
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+### MoveDownButton
+
+The `MoveDownButton` is used to render a move down action on a `Form` for elements in an array.
+You can customize the `MoveDownButton` to render something other than the icon button that is provided by a theme as follows:
+
+```tsx
+import React from 'react';
+import { IconButtonProps, RJSFSchema } from '@rjsf/utils';
+import { FormattedMessage } from 'react-intl';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'string',
+};
+
+function MoveDownButton(props: IconButtonProps) {
+ const { icon, iconType, ...btnProps } = props;
+ return (
+
+ );
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+### MoveUpButton
+
+The `MoveUpButton` is used to render a move up action on a `Form` for elements in an array.
+You can customize the `MoveUpButton` to render something other than the icon button that is provided by a theme as follows:
+
+```tsx
+import React from 'react';
+import { IconButtonProps, RJSFSchema } from '@rjsf/utils';
+import { FormattedMessage } from 'react-intl';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'string',
+};
+
+function MoveUpButton(props: IconButtonProps) {
+ const { icon, iconType, ...btnProps } = props;
+ return (
+
+ );
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+### RemoveButton
+
+The `RemoveButton` is used to render a remove action on a `Form` for both a existing `additionalProperties` element for an object or an existing element in an array.
+You can customize the `RemoveButton` to render something other than the icon button that is provided by a theme as follows:
+
+```tsx
+import React from 'react';
+import { IconButtonProps, RJSFSchema } from '@rjsf/utils';
+import { FormattedMessage } from 'react-intl';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'string',
+};
+
+function RemoveButton(props: IconButtonProps) {
+ const { icon, iconType, ...btnProps } = props;
+ return (
+
+ );
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+### SubmitButton
+
+The `SubmitButton` is already very customizable via the `UISchemaSubmitButtonOptions` capabilities in the `uiSchema` but it can also be fully customized as you see fit.
+
+> NOTE: However you choose to implement this, making it something other than a `submit` type `button` may result in the `Form` not submitting when pressed.
+> You could also choose to provide your own submit button as the [children prop](../api-reference/form-props.md#children) of the `Form` should you so choose.
+
+```tsx
+import React from 'react';
+import { getSubmitButtonOptions, RJSFSchema, SubmitButtonProps } from '@rjsf/utils';
+import { FormattedMessage } from 'react-intl';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'string',
+};
+
+function SubmitButton(props: SubmitButtonProps) {
+ const { uiSchema } = props;
+ const { norender } = getSubmitButtonOptions(uiSchema);
+ if (norender) {
+ return null;
+ }
+ return (
+
+ );
+}
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+The following prop is passed to a `SubmitButton`:
+
+- `uiSchema`: The uiSchema object for this field, used to extract the `UISchemaSubmitButtonOptions`.
+- `registry`: The `registry` object.
diff --git a/packages/docs/versioned_docs/version-5.24.10/advanced-customization/custom-themes.md b/packages/docs/versioned_docs/version-5.24.10/advanced-customization/custom-themes.md
new file mode 100644
index 0000000000..374a37ab7b
--- /dev/null
+++ b/packages/docs/versioned_docs/version-5.24.10/advanced-customization/custom-themes.md
@@ -0,0 +1,117 @@
+# Custom Themes
+
+The `withTheme` component provides an easy way to extend the functionality of react-jsonschema-form by passing in a theme object that defines custom/overridden widgets and fields, as well as any of the other possible properties of the standard rjsf `Form` component.
+This theme-defining object is passed as the only parameter to the HOC (`withTheme(ThemeObj)`), and the HOC will return a themed-component which you use instead of the standard `Form` component.
+
+## Usage
+
+```tsx
+import React, { Component } from 'react';
+import validator from '@rjsf/validator-ajv8';
+import { withTheme, ThemeProps } from '@rjsf/core';
+
+const theme: ThemeProps = { widgets: { test: () =>
test
} };
+
+const ThemedForm = withTheme(theme);
+
+const Demo = () => ;
+```
+
+## Theme object properties
+
+The Theme object consists of the same properties as the rjsf `Form` component (such as **widgets**, **fields** and **templates**).
+The themed-Form component merges together any theme-specific **widgets**, **fields** and **templates** with the default **widgets**, **fields** and **templates**.
+For instance, providing a single widget in **widgets** will merge this widget with all the default widgets of the rjsf `Form` component, but overrides the default if the theme's widget's name matches the default widget's name.
+Thus, for each default widget or field not specified/overridden, the themed-form will rely on the defaults from the rjsf `Form`.
+Note that you are not required to pass in either custom **widgets**, **fields** or **templates** when using the custom-themed HOC component;
+you can essentially redefine the default Form by simply doing `const Form = withTheme({});`.
+
+### Widgets and fields
+
+**widgets** and **fields** should be in the same format as shown [here](./custom-widgets-fields.md).
+
+Example theme with custom widget:
+
+```tsx
+import { WidgetProps, RegistryWidgetsType } from '@rjsf/utils';
+import { ThemeProps } from '@rjsf/core';
+
+const MyCustomWidget = (props: WidgetProps) => {
+ return (
+ props.onChange(event.target.value)}
+ />
+ );
+};
+
+const myWidgets: RegistryWidgetsType = {
+ myCustomWidget: MyCustomWidget,
+};
+
+const ThemeObject: ThemeProps = { widgets: myWidgets };
+export default ThemeObject;
+```
+
+The above can be similarly done for **fields** and **templates**.
+
+### Templates
+
+Each template should be passed into the theme object via the **templates** object just as you would into the rjsf Form component. Here is an example of how to use a custom [ArrayFieldTemplate](./custom-templates.md#arrayfieldtemplate) and [ErrorListTemplate](./custom-templates.md#errorlisttemplate) in the theme object:
+
+```tsx
+import { ArrayFieldTemplateProps, ErrorListProps } from '@rjsf/utils';
+import { ThemeProps } from '@rjsf/core';
+
+function MyArrayFieldTemplate(props: ArrayFieldTemplateProps) {
+ return (
+
+ );
+}
+
+const ThemeObject: ThemeProps = {
+ templates: {
+ ArrayFieldTemplate: MyArrayFieldTemplate,
+ ErrorListTemplate: MyErrorListTemplate,
+ },
+ widgets: myWidgets,
+};
+
+export default ThemeObject;
+```
+
+## Overriding other Form props
+
+Just as the theme can override **widgets**, **fields**, any of the **templates**, and set default values to properties like **showErrorList**, you can do the same with the instance of the withTheme() Form component.
+
+```tsx
+import { ThemeProps } from '@rjsf/core';
+
+const ThemeObject: ThemeProps = {
+ templates: {
+ ArrayFieldTemplate: MyArrayFieldTemplate,
+ },
+ fields: myFields,
+ showErrorList: false,
+ widgets: myWidgets,
+};
+```
+
+Thus, the user has higher priority than the withTheme HOC, and the theme has higher priority than the default values of the rjsf Form component (**User** > **Theme** > **Defaults**).
diff --git a/packages/docs/versioned_docs/version-5.24.10/advanced-customization/custom-widgets-fields.md b/packages/docs/versioned_docs/version-5.24.10/advanced-customization/custom-widgets-fields.md
new file mode 100644
index 0000000000..628752fee8
--- /dev/null
+++ b/packages/docs/versioned_docs/version-5.24.10/advanced-customization/custom-widgets-fields.md
@@ -0,0 +1,547 @@
+# Custom Widgets and Fields
+
+The API allows to specify your own custom _widget_ and _field_ components:
+
+- A _widget_ represents a HTML tag for the user to enter data, eg. `input`, `select`, etc.
+- A _field_ usually wraps one or more widgets and most often handles internal field state; think of a field as a form row, including the labels.
+
+## Customizing the default fields and widgets
+
+You can override any default field and widget, including the internal widgets like the `CheckboxWidget` that `BooleanField` renders for boolean values. You can override any field and widget just by providing the customized fields/widgets in the `fields` and `widgets` props:
+
+```tsx
+import { RJSFSchema, UiSchema, WidgetProps, RegistryWidgetsType } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'boolean',
+ default: true,
+};
+
+const uiSchema: UiSchema = {
+ 'ui:widget': 'checkbox',
+};
+
+const CustomCheckbox = function (props: WidgetProps) {
+ return (
+
+ );
+};
+
+const widgets: RegistryWidgetsType = {
+ CheckboxWidget: CustomCheckbox,
+};
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+This allows you to create a reusable customized form class with your custom fields and widgets:
+
+```tsx
+import { RegistryFieldsType, RegistryWidgetsType } from '@rjsf/utils';
+import { FormProps } from '@rjsf/core';
+
+const customFields: RegistryFieldsType = { StringField: CustomString };
+const customWidgets: RegistryWidgetsType = { CheckboxWidget: CustomCheckbox };
+
+function MyForm(props: FormProps) {
+ return ;
+}
+```
+
+The default fields you can override are:
+
+- `ArrayField`
+- `ArraySchemaField`
+- `BooleanField`
+- `DescriptionField`
+- `OneOfField`
+- `AnyOfField`
+- `NullField`
+- `NumberField`
+- `ObjectField`
+- `SchemaField`
+- `StringField`
+- `TitleField`
+- `UnsupportedField`
+
+The default widgets you can override are:
+
+- `AltDateTimeWidget`
+- `AltDateWidget`
+- `CheckboxesWidget`
+- `CheckboxWidget`
+- `ColorWidget`
+- `DateTimeWidget`
+- `DateWidget`
+- `EmailWidget`
+- `FileWidget`
+- `HiddenWidget`
+- `PasswordWidget`
+- `RadioWidget`
+- `RangeWidget`
+- `SelectWidget`
+- `TextareaWidget`
+- `TextWidget`
+- `TimeWidget`
+- `UpDownWidget`
+- `URLWidget`
+
+## Raising errors from within a custom widget or field
+
+You can raise custom 'live validation' errors by overriding the `onChange` method to provide feedback while users are actively changing the form data.
+Note that these errors are temporary and are not recognized during the form validation process.
+
+:::warning
+
+This method of raising errors _only_ runs during `onChange`, i.e. when the user is changing data. This will not catch errors `onSubmit`, i.e when submitting the form.
+If you wish to add generic validation logic for your component, you should use the [`customValidate` Form prop](../api-reference/form-props.md#customvalidate).
+
+:::
+
+```tsx
+import { ErrorSchema, RJSFSchema, UiSchema, WidgetProps, RegistryWidgetsType } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'text',
+ default: 'hello',
+};
+
+const uiSchema: UiSchema = {
+ 'ui:widget': 'text',
+};
+
+const CustomTextWidget = function (props: WidgetProps) {
+ const { id, value } = props;
+ const raiseErrorOnChange = ({ target: { value } }: ChangeEvent) => {
+ let raiseError: ErrorSchema | undefined;
+ if (value !== 'test') {
+ raiseError = {
+ __errors: ['Value must be "test"'],
+ };
+ }
+ props.onChange(value, raiseError, id);
+ };
+
+ return ;
+};
+
+const widgets: RegistryWidgetsType = {
+ TextWidget: CustomTextWidget,
+};
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+This creates a custom text widget that raises an error if the input value does not match 'test'.
+
+## Adding your own custom widgets
+
+You can provide your own custom widgets to a uiSchema for the following json data types:
+
+- `string`
+- `number`
+- `integer`
+- `boolean`
+- `array`
+
+```tsx
+import { RJSFSchema, UiSchema, WidgetProps } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: Schema = {
+ type: 'string',
+};
+
+const uiSchema: UiSchema = {
+ 'ui:widget': (props: WidgetProps) => {
+ return (
+ props.onChange(event.target.value)}
+ />
+ );
+ },
+};
+
+render(, document.getElementById('app'));
+```
+
+The following props are passed to custom widget components:
+
+- `id`: The generated id for this widget, used to provide unique `name`s and `id`s for the HTML field elements rendered by widgets;
+- `name`: The unique name of the field, usually derived from the name of the property in the JSONSchema; Provided in support of custom widgets;
+- `schema`: The JSONSchema subschema object for this widget;
+- `uiSchema`: The uiSchema for this widget;
+- `value`: The current value for this widget;
+- `placeholder`: The placeholder for the widget, if any;
+- `required`: The required status of this widget;
+- `disabled`: A boolean value stating if the widget is disabled;
+- `readonly`: A boolean value stating if the widget is read-only;
+- `autofocus`: A boolean value stating if the widget should autofocus;
+- `label`: The computed label for this widget, as a string
+- `hideLabel`: A boolean value, if true, will cause the label to be hidden. This is useful for nested fields where you don't want to clutter the UI. Customized via `label` in the `UiSchema`;
+- `multiple`: A boolean value stating if the widget can accept multiple values;
+- `onChange`: The value change event handler; call it with the new value every time it changes;
+- `onKeyChange`: The key change event handler (only called for fields with `additionalProperties`); pass the new value every time it changes;
+- `onBlur`: The input blur event handler; call it with the widget id and value;
+- `onFocus`: The input focus event handler; call it with the widget id and value;
+- `options`: A map of options passed as a prop to the component (see [Custom widget options](#custom-widget-options)).
+- `options.enumOptions`: For enum fields, this property contains the list of options for the enum as an array of { label, value } objects. If the enum is defined using the oneOf/anyOf syntax, the entire schema object for each option is appended onto the { schema, label, value } object.
+- `formContext`: The `formContext` object that you passed to `Form`.
+- `rawErrors`: An array of strings listing all generated error messages from encountered errors for this widget.
+- `registry`: A [registry](#the-registry-object) object (read next).
+
+### Custom component registration
+
+Alternatively, you can register them all at once by passing the `widgets` prop to the `Form` component, and reference their identifier from the `uiSchema`:
+
+```tsx
+import { RJSFSchema, UiSchema, WidgetProps, RegistryWidgetsType } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const MyCustomWidget = (props: WidgetProps) => {
+ return (
+ props.onChange(event.target.value)}
+ />
+ );
+};
+
+const widgets: RegistryWidgetsType = {
+ myCustomWidget: MyCustomWidget,
+};
+
+const schema: RJSFSchema = {
+ type: 'string',
+};
+
+const uiSchema: UiSchema = {
+ 'ui:widget': 'myCustomWidget',
+};
+
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+This is useful if you expose the `uiSchema` as pure JSON, which can't carry functions.
+
+### Custom widget options
+
+If you need to pass options to your custom widget, you can add a `ui:options` object containing those properties. If the widget has `defaultProps`, the options will be merged with the (optional) options object from `defaultProps`:
+
+```tsx
+import { RJSFSchema, UiSchema, WidgetProps } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'string',
+};
+
+function MyCustomWidget(props: WidgetProps) {
+ const { options } = props;
+ const { color, backgroundColor } = options;
+ return ;
+}
+
+MyCustomWidget.defaultProps = {
+ options: {
+ color: 'red',
+ },
+};
+
+const uiSchema: UiSchema = {
+ 'ui:widget': MyCustomWidget,
+ 'ui:options': {
+ backgroundColor: 'yellow',
+ },
+};
+
+// renders red on yellow input
+render(, document.getElementById('app'));
+```
+
+> Note: This also applies to [registered custom components](#custom-component-registration).
+
+> Note: Since v0.41.0, the `ui:widget` object API, where a widget and options were specified with `"ui:widget": {component, options}` shape, is deprecated. It will be removed in a future release.
+
+### Customizing widgets' text input
+
+All the widgets that render a text input use the `BaseInputTemplate` component internally. If you need to customize all text inputs without customizing all widgets individually, you can provide a `BaseInputTemplate` component in the `templates` property of `Form` (see [Custom Templates](./custom-templates.md#baseinputtemplate)).
+
+### Wrapping an existing widget to customize it
+
+Sometimes you just need to customize the properties that are passed to an existing widget.
+The way to do this varies based upon whether you are using core or some other theme (such as mui).
+
+Here is an example of modifying the `SelectWidget` to change the ordering of `enumOptions`:
+
+```tsx
+import { WidgetProps } from '@rjsf/utils';
+import { getDefaultRegistry } from '@rjsf/core';
+import { Widgets } from '@rjsf/mui';
+
+import myOptionsOrderFunction from './myOptionsOrderFunction';
+
+const {
+ widgets: { SelectWidget },
+} = getDefaultRegistry(); // To get widgets from core
+// const { SelectWidget } = Widgets; // To get widgets from a theme do this
+
+function MySelectWidget(props: WidgetProps) {
+ const { options } = props;
+ let { enumOptions } = options;
+ // Reorder the `enumOptions` however you want
+ enumOptions = myOptionsOrderFunction(enumOptions);
+ return ;
+}
+```
+
+## Custom field components
+
+You can provide your own field components to a uiSchema for basically any json schema data type, by specifying a `ui:field` property.
+
+For example, let's create and register a dumb `geo` component handling a _latitude_ and a _longitude_:
+
+```tsx
+import { RJSFSchema, UiSchema, FieldProps, RegistryFieldsType } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const schema: RJSFSchema = {
+ type: 'object',
+ required: ['lat', 'lon'],
+ properties: {
+ lat: { type: 'number' },
+ lon: { type: 'number' },
+ },
+};
+
+// Define a custom component for handling the root position object
+class GeoPosition extends React.Component {
+ constructor(props: FieldProps) {
+ super(props);
+ this.state = { ...props.formData };
+ }
+
+ onChange(name) {
+ return (event) => {
+ this.setState(
+ {
+ [name]: parseFloat(event.target.value),
+ },
+ () => this.props.onChange(this.state)
+ );
+ };
+ }
+
+ render() {
+ const { lat, lon } = this.state;
+ return (
+
+
+
+
+ );
+ }
+}
+
+// Define the custom field component to use for the root object
+const uiSchema: UiSchema = { 'ui:field': 'geo' };
+
+// Define the custom field components to register; here our "geo"
+// custom field component
+const fields: RegistryFieldsType = { geo: GeoPosition };
+
+// Render the form with all the properties we just defined passed
+// as props
+render(
+ ,
+ document.getElementById('app')
+);
+```
+
+> Note: Registered fields can be reused across the entire schema.
+
+### Field props
+
+A field component will always be passed the following props:
+
+- `schema`: The JSON subschema object for this field;
+- `uiSchema`: The [uiSchema](../api-reference/uiSchema.md) for this field;
+- `idSchema`: The tree of unique ids for every child field;
+- `formData`: The data for this field;
+- `errorSchema`: The tree of errors for this field and its children;
+- `registry`: A [registry](#the-registry-object) object (read next).
+- `formContext`: A [formContext](../api-reference/form-props.md#formcontext) object (read next).
+- `required`: The required status of this field;
+- `disabled`: A boolean value stating if the field is disabled;
+- `readonly`: A boolean value stating if the field is read-only;
+- `autofocus`: A boolean value stating if the field should autofocus;
+- `name`: The unique name of the field, usually derived from the name of the property in the JSONSchema
+- `idPrefix`: To avoid collisions with existing ids in the DOM, it is possible to change the prefix used for ids; Default is `root`
+- `idSeparator`: To avoid using a path separator that is present in field names, it is possible to change the separator used for ids (Default is `_`)
+- `rawErrors`: `An array of strings listing all generated error messages from encountered errors for this field
+- `onChange`: The field change event handler; called with the updated form data and an optional `ErrorSchema`
+- `onBlur`: The input blur event handler; call it with the field id and value;
+- `onFocus`: The input focus event handler; call it with the field id and value;
+
+## The `registry` object
+
+The `registry` is an object containing the registered core, theme and custom fields and widgets as well as the root schema, form context, schema utils.
+
+- `fields`: The set of all fields used by the `Form`. Includes fields from `core`, theme-specific fields and any [custom registered fields](#custom-field-components);
+- `widgets`: The set of all widgets used by the `Form`. Includes widgets from `core`, theme-specific widgets and any [custom registered widgets](#custom-component-registration), if any;
+- `rootSchema`: The root schema, as passed to the `Form`, which can contain referenced [definitions](../json-schema/definitions.md);
+- `formContext`: The [formContext](../api-reference/form-props.md#formcontext) that was passed to `Form`;
+- `schemaUtils`: The current implementation of the `SchemaUtilsType` (from `@rjsf/utils`) in use by the `Form`. Used to call any of the validation-schema-based utility functions.
+
+The registry is passed down the component tree, so you can access it from your custom field, custom widget, custom template and `SchemaField` components.
+
+### Custom SchemaField
+
+**Warning:** This is a powerful feature as you can override the whole form behavior and easily mess it up. Handle with care.
+
+You can provide your own implementation of the `SchemaField` base React component for rendering any JSONSchema field type, including objects and arrays. This is useful when you want to augment a given field type with supplementary powers.
+
+To proceed so, pass a `fields` object having a `SchemaField` property to your `Form` component; here's an example:
+
+```tsx
+import { RJSFSchema, FieldProps, RegistryFieldsType } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const CustomSchemaField = function (props: FieldProps) {
+ return (
+
+
Yeah, I'm pretty dumb.
+
My props are: {JSON.stringify(props)}
+
+ );
+};
+
+const fields: RegistryFieldsType = {
+ SchemaField: CustomSchemaField,
+};
+
+const schema: RJSFSchema = {
+ type: 'string',
+};
+
+render(, document.getElementById('app'));
+```
+
+If you're curious how this could ever be useful, have a look at the [Kinto formbuilder](https://github.com/Kinto/formbuilder) repository to see how it's used to provide editing capabilities to any form field.
+
+Props passed to a custom SchemaField are the same as [the ones passed to a custom field](#field-props).
+
+### Custom ArraySchemaField
+
+Everything that was mentioned above for a `Custom SchemaField` applies, but this is only used to render the Array item `children` that are then passed to the `ArrayFieldItemTemplate`.
+By default, `ArraySchemaField` is not actually implemented in the `fields` list since `ArrayField` falls back to `SchemaField` if `ArraySchemaField` is not provided.
+If you want to customize how the individual items for an array are rendered, provide your implementation of `ArraySchemaField` as a `fields` override.
+
+```tsx
+import { RJSFSchema, UiSchema, FieldProps, RegistryFieldsType } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const CustomArraySchemaField = function (props: FieldProps) {
+ const { index, registry } = props;
+ const { SchemaField } = registry.fields;
+ const name = `Index ${index}`;
+ return ;
+};
+
+const fields: RegistryFieldsType = {
+ ArraySchemaField: CustomArraySchemaField,
+};
+
+const schema: RJSFSchema = {
+ type: 'string',
+};
+
+render(, document.getElementById('app'));
+```
+
+### Custom Field by Id
+
+**Warning:** This is a powerful feature as you can override the whole form behavior and easily mess it up. Handle with care.
+
+You can provide your own implementation of the field component that applies to any schema or sub-schema based on the schema's `$id` value. This is useful when your custom field should be conditionally applied based on the schema rather than the property name or data type.
+
+To provide a custom field in this way, the `fields` prop should be an object which contains a key that matches the `$id` value of the schema which should have a custom field; here's an example:
+
+```tsx
+import { RJSFSchema, FieldProps, RegistryFieldsType } from '@rjsf/utils';
+import validator from '@rjsf/validator-ajv8';
+
+const CustomIdField = function (props: FieldProps) {
+ return (
+
+
Yeah, I'm pretty dumb.
+
My props are: {JSON.stringify(props)}
+
+ );
+};
+
+const fields: RegistryFieldsType = {
+ '/schemas/my-id': CustomIdField,
+};
+
+const schema: RJSFSchema = {
+ $id: '/schemas/my-id',
+ type: 'string',
+};
+
+render(, document.getElementById('app'));
+```
+
+### Wrapping an existing field to customize it
+
+Sometimes you just need to customize the properties that are passed to an existing field.
+
+Here is an example of wrapping the `ObjectField` to tweak the `onChange` handler to look for a specific kind of bad data:
+
+```tsx
+import { useCallback } from 'react';
+import { FieldProps } from '@rjsf/utils';
+import { getDefaultRegistry } from '@rjsf/core';
+
+import checkBadData from './checkBadData';
+
+const {
+ fields: { ObjectField },
+} = getDefaultRegistry();
+
+function MyObjectField(props: FieldProps) {
+ const { onChange } = props;
+ const onChangeHandler = useCallback(
+ (newFormData: T | undefined, es?: ErrorSchema, id?: string) => {
+ let data = newFormData;
+ let error = es;
+ if (checkBadData(newFormData)) {
+ // Format the `error` and fix the `data` here
+ }
+ onChange(data, error, id);
+ },
+ [onChange]
+ );
+ return ;
+}
+```
diff --git a/packages/docs/versioned_docs/version-5.24.10/advanced-customization/index.mdx b/packages/docs/versioned_docs/version-5.24.10/advanced-customization/index.mdx
new file mode 100644
index 0000000000..d645a03381
--- /dev/null
+++ b/packages/docs/versioned_docs/version-5.24.10/advanced-customization/index.mdx
@@ -0,0 +1,11 @@
+---
+title: Advanced Customization
+description: Advanced customization documentation for react-jsonschema-form.
+
+---
+
+import DocCardList from '@theme/DocCardList';
+
+
{frontMatter.description}
+
+
\ No newline at end of file
diff --git a/packages/docs/versioned_docs/version-5.24.10/advanced-customization/internals.md b/packages/docs/versioned_docs/version-5.24.10/advanced-customization/internals.md
new file mode 100644
index 0000000000..1252f5b91e
--- /dev/null
+++ b/packages/docs/versioned_docs/version-5.24.10/advanced-customization/internals.md
@@ -0,0 +1,102 @@
+# Internals
+
+Miscellaneous internals of react-jsonschema-form are listed here.
+
+## JSON Schema supporting status
+
+This component follows [JSON Schema](http://json-schema.org/documentation.html) specs. We currently support JSON Schema-07 by default, but we also support other JSON schema versions through the [custom schema validation](../usage/validation.md#custom-meta-schema-validation) feature. Due to the limitation of form widgets, there are some exceptions as follows:
+
+- `additionalItems` keyword for arrays
+
+ This keyword works when `items` is an array. `additionalItems: true` is not supported because there's no widget to represent an item of any type. In this case it will be treated as no additional items allowed. `additionalItems` being a valid schema is supported.
+
+- `anyOf`, `allOf`, and `oneOf`, or multiple `types` (i.e. `"type": ["string", "array"]`)
+
+ The `anyOf` and `oneOf` keywords are supported; however, properties declared inside the `anyOf/oneOf` should not overlap with properties "outside" of the `anyOf/oneOf`.
+
+ You can also use `oneOf` with [schema dependencies](../json-schema/dependencies.md#schema-dependencies) to dynamically add schema properties based on input data.
+
+ The `allOf` keyword is supported; it uses [json-schema-merge-allof](https://github.com/mokkabonna/json-schema-merge-allof) to merge subschemas to render the final combined schema in the form. When these subschemas are incompatible, though (or if the library has an error merging it), the `allOf` keyword is dropped from the schema.
+
+- `"additionalProperties":false` produces incorrect schemas when used with [schema dependencies](../json-schema/dependencies.md#schema-dependencies). This library does not remove extra properties, which causes validation to fail. It is recommended to avoid setting `"additionalProperties":false` when you use schema dependencies. See [#848](https://github.com/rjsf-team/react-jsonschema-form/issues/848) [#902](https://github.com/rjsf-team/react-jsonschema-form/issues/902) [#992](https://github.com/rjsf-team/react-jsonschema-form/issues/992)
+
+## Handling of schema defaults
+
+This library automatically fills default values defined in the [JSON Schema](http://json-schema.org/documentation.html) as initial values in your form. This also works for complex structures in the schema. If a field has a default defined, it should always appear as default value in form. This also works when using [schema dependencies](../json-schema/dependencies.md#schema-dependencies).
+
+Since there is a complex interaction between any supplied original form data and any injected defaults, this library tries to do the injection in a way which keeps the original intention of the original form data.
+
+Check out the defaults example on the [live playground](https://rjsf-team.github.io/react-jsonschema-form/) to see this in action.
+
+### Merging of defaults into the form data
+
+There are three different cases which need to be considered for the merging. Objects, arrays and scalar values. This library always deeply merges any defaults with the existing form data for objects.
+
+This are the rules which are used when injecting the defaults:
+
+- When there is a scalar in the form data, nothing is changed.
+- When the value is `undefined` in the form data, the default is created in the form data.
+- When the value is an object in the form data, the defaults are deeply merged into the form data, using the rules defined here for the deep merge.
+- Then the value is an array in the form data, defaults are only injected in existing array items. No new array items will be created, even if the schema has minItems or additional items defined.
+
+### Merging of defaults within the schema
+
+In the schema itself, defaults of parent elements are propagated into children. So when you have a schema which defines a deeply nested object as default, these defaults will be applied to children of the current node. This also merges objects defined at different levels together with the "deeper" not having precedence. If the parent node defines properties, which are not defined in the child, they will be merged so that the default for the child will be the merged defaults of parent and child.
+
+For arrays this is not the case. Defining an array, when a parent also defines an array, will be overwritten. This is only true when arrays are used in the same level, for objects within these arrays, they will be deeply merged again.
+
+## Custom array field buttons
+
+The `ArrayField` component provides a UI to add, copy, remove and reorder array items, and these buttons use [Bootstrap glyphicons](http://getbootstrap.com/components/#glyphicons).
+If you don't use glyphicons but still want to provide your own icons or texts for these buttons, you can easily do so using CSS:
+
+> NOTE this only applies to the `@rjsf/core` theme
+
+```css
+i.glyphicon {
+ display: none;
+}
+.btn-add::after {
+ content: 'Add';
+}
+.array-item-copy::after {
+ content: 'Copy';
+}
+.array-item-move-up::after {
+ content: 'Move Up';
+}
+.array-item-move-down::after {
+ content: 'Move Down';
+}
+.array-item-remove::after {
+ content: 'Remove';
+}
+```
+
+## Submit form programmatically
+
+You can use the reference to get your `Form` component and call the `submit` method to submit the form programmatically without a submit button.
+This method will dispatch the `submit` event of the form, and the function, that is passed to `onSubmit` props, will be called.
+
+```tsx
+import { createRef } from 'react';
+import { RJSFSchema, UiSchema } from '@rjsf/utils';
+import { Form } from '@rjsf/core';
+import validator from '@rjsf/validator-ajv8';
+
+const onSubmit = ({ formData }) => console.log('Data submitted: ', formData);
+let yourForm;
+
+const schema: RJSFSchema = {
+ type: 'string',
+};
+
+const formRef = createRef,
+ document.getElementById('app')
+);
+
+formRef.current.submit();
+```
diff --git a/packages/docs/versioned_docs/version-5.24.10/advanced-customization/typescript.md b/packages/docs/versioned_docs/version-5.24.10/advanced-customization/typescript.md
new file mode 100644
index 0000000000..15205d017a
--- /dev/null
+++ b/packages/docs/versioned_docs/version-5.24.10/advanced-customization/typescript.md
@@ -0,0 +1,279 @@
+# Typescript Support
+
+RJSF fully supports Typescript.
+The [types and functions](../api-reference/utility-functions.md) exported by `@rjsf/utils` are fully typed (as needed) using one or more of the following 3 optional generics:
+
+- `T = any`: This represents the type of the `formData` and defaults to `any`.
+- `S extends StrictRJSFSchema = RJSFSchema`: This represents the type of the `schema` and extends the `StrictRJSFSchema` type and defaults to the `RJSFSchema` type.
+- `F extends FormContextType = any`: This represents the type of the `formContext`, extends the `FormContextType` type and defaults to `any`.
+
+Every other library in the `@rjsf/*` ecosystem use these same generics in their functions and React component definitions.
+For instance, in the `@rjsf/core` library the definitions of the `Form` component and the `withTheme()` and `getDefaultRegistry()` functions are as follows:
+
+```ts
+export default class Form<
+ T = any,
+ S extends StrictRJSFSchema = RJSFSchema,
+ F extends FormContextType = any
+> extends Component, FormState> {
+ // ... class implementation
+}
+
+export default function withTheme(
+ themeProps: ThemeProps
+) {
+ // ... function implementation
+}
+
+export default function getDefaultRegistry<
+ T = any,
+ S extends StrictRJSFSchema = RJSFSchema,
+ F extends FormContextType = any
+>(): Omit, 'schemaUtils'> {
+ // ... function implementation
+}
+```
+
+Out of the box, the defaults for these generics will work for all use-cases.
+Providing custom types for any of these generics may be useful for situations where the caller is working with typed `formData`, `schema` or `formContext` props, Typescript is complaining and type casting isn't allowed.
+
+## Overriding generics
+
+### T
+
+The generic `T` is used to represent the type of the `formData` property passed into `Form`.
+If you are working with a simple, unchanging JSON Schema and you have defined a type for the `formData` you are working with, you can override this generic as follows:
+
+```tsx
+import { RJSFSchema } from '@rjsf/utils';
+import { customizeValidator } from '@rjsf/validator-ajv8';
+import { Form } from '@rjsf/core';
+
+interface FormData {
+ foo?: string;
+ bar?: number;
+}
+
+const schema: RJSFSchema = {
+ type: 'object',
+ properties: {
+ foo: { type: 'string' },
+ bar: { type: 'number' },
+ },
+};
+
+const formData: FormData = {};
+
+const validator = customizeValidator();
+
+render(