operational-ui icon indicating copy to clipboard operation
operational-ui copied to clipboard

Feature Request: Form schemas

Open justinmchase opened this issue 3 years ago • 0 comments

It may be asking for a lot but it would be super sweet if the forms could be auto-generated based on a Json Schema object being passed in.

Something like:

import * as React from "react"
import { Form, Input, Button } from "@operational/components"
const schema = {
  type: "object",
  properties: {
    firstName: { type: "string" },
    lastName: { type: "string" }
  }
}
const data = {
  firstName = 'Justin',
  lastName = 'Chase'
}
;<Form schema={schema} data={data}>
</Form>

And that would render a form with the appropriate fields.

There is a project already that does this react-jsonschema-form, perhaps its just a matter of bundling it and adding a custom theme?

justinmchase avatar Jun 14 '21 15:06 justinmchase