React JSONSchema Form
An integration of https://github.com/rjsf-team/react-jsonschema-form into Drupal's Form and Field APIs.
For additional documentation on this module read the docs at https://rjsf.ctrladel.io/
Form API Usage
$form['rjsf_element'] = [
'#type' => 'rjsf_editor',
'#server_validation' => TRUE,
'#live_validation' => TRUE,
'#schema' => [
'title' => 'A registration form',
'description' => 'A simple form example.',
'type' => 'object',
'required' => ['firstName', 'lastName'],
'properties' => [
'firstName' => [
'type' => 'string',
'title' => 'First name',
'default' => 'Chuck',
],
'lastName' => [
'type' => 'string',
'title' => 'Last name',
],
'telephone' => [
'type' => 'string',
'title' => 'Telephone',
'minLength' => 10,
],
],
],
'#uiSchema' => [
'firstName' => [
'ui:autofocus' => TRUE,
'ui:emptyValue' => '',
'ui:autocomplete' => 'family-name',
],
'lastName' => [
'ui:emptyValue' => '',
'ui:autocomplete' => 'given-name',
],
'age' => [
'ui:widget' => 'updown',
'ui:title' => 'Age of person',
'ui:description' => '(earthian year)',
],
'bio' => [
'ui:widget' => 'textarea',
],
'password' => [
'ui:widget' => 'password',
'ui:help' => 'Hint: Make it strong!',
],
'date' => [
'ui:widget' => 'alt-datetime',
],
'telephone' => [
'ui:options' => [
'inputType' => 'tel',
],
],
],
];
Field API Usage
When using RJSF on an entity the schema and uiSchema json can be pasted directly into the field settings which is then passed to RJSF when the entities form is rendered.
Install instructions
The easiest way to ensure the editor and widgets are available is to use asset-packagist and require the @drupal-rjsf/editor npm package for this module as a composer dependency. To set up your project to use asset-packagist see here. Then run `composer require npm-asset/drupal-rjsf--edtior`
For more details instructions see https://rjsf.ctrladel.io/installation
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | Release date | |
|---|---|---|---|---|
| 1.0.0-alpha40 | Pre-release | Dec 15, 2023 | ||
| 1.0.0-alpha39 | Pre-release | Dec 15, 2023 | ||
| 1.0.0-alpha36 | Pre-release | Dec 6, 2023 | ||
| 1.0.0-alpha31 | Pre-release | Jul 7, 2023 | ||
| 1.0.0-alpha30 | Pre-release | Jul 4, 2023 | ||
| 1.0.0-alpha28 | Pre-release | Apr 29, 2023 |