Skip to content

Conversation

@n1k0
Copy link
Collaborator

@n1k0 n1k0 commented Dec 22, 2015

Ready for review.

Alternative widgets

JSONSchema is limited for describing how a given data type should be rendered as an input component, that's why this lib introduces the concept of UI schema. A UI schema is basically an object literal describing which UI widget should be used to render a certain field

Example:

const uiSchema =  {
  done: {
    widget: "radio" // could also be "select"
  }
};

render((
  <Form schema={schema}
        uiSchema={uiSchema}
        formData={formData} />
), document.getElementById("app"));

Here's a list of supported alternative widgets for different JSONSchema data types:

boolean

  • radio: a radio button group with true and false as selectable values;
  • select: a select box with true and false as options;
  • by default, a checkbox is used

string:

  • textarea: a textarea element
  • by default, a regular input[type=text] element is used.

@n1k0 n1k0 force-pushed the uiSchema branch 4 times, most recently from 0606c72 to 18dbe34 Compare December 22, 2015 13:19
@Natim
Copy link
Contributor

Natim commented Dec 22, 2015

LGTM thanks 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to console.log.bind(console, "change") like you did above for submit and errors?

n1k0 added a commit that referenced this pull request Dec 22, 2015
@n1k0 n1k0 merged commit 284b24a into master Dec 22, 2015
@n1k0 n1k0 deleted the uiSchema branch December 22, 2015 15:30
epicfaace pushed a commit that referenced this pull request Feb 4, 2022
Add Date, Date Time, URL Widgets, Text Area Updates
James-Brown98 referenced this pull request in James-Brown98/react-jsonschema-form Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants