Custom widget for type object in rjsf

628 views Asked by At

Im trying to create a custom widget to write a free json using a text area. But @rjsf/core form doesnt seem to allow it. My custom JsonWidget component is a text area, but the default widget is appearing.

import RjsfCoreForm from "@rjsf/core";
import { JsonWidget } from "./JsonWidget";

const schema = {
  type: "object",
  properties: {
    free_object: {
      type: "object",
      additionalProperties: true
    }
  }
}

const uiSchema = {
  free_object: { "ui:widget": "JsonWidget" }
}

const widgets = { JsonWidget }

export default function App() {
  return (
    <div className="App">
      <h3>Form</h3>
      <RjsfCoreForm schema={schema} widgets={widgets} uiSchema={uiSchema} />
    </div>
  )
}

Is there any way to do it? You can check the demo here.

1

There are 1 answers

0
Rashomon On

Seems like its not possible (found at docs):

You can provide your own custom widgets to a uiSchema for the following json data types:

string

number

integer

boolean

array