Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a block of text or image #1146

Closed
epicfaace opened this issue Jan 21, 2019 · 3 comments
Closed

Adding a block of text or image #1146

epicfaace opened this issue Jan 21, 2019 · 3 comments
Labels
feature Is a feature request

Comments

@epicfaace
Copy link
Member

It would be nice to be able to add a "block" which contains a title / image / text / custom JSX. Kind of like how in Google forms, you can add these kinds of blocks.

image

Is there a way to specify this in the JSON Schema spec? Or perhaps we would need a modification in the UISchema?

@loganvolkers
Copy link
Contributor

JSON Schema spec

There is nothing in the JSON schema spec that provides such capabilities for custom blocks.

One thing that I have seen done is providing Markdown support in the title and description fields, such as in the Open API Specification.

We have implemented this using a custom FieldTemplate property, but the easiest is via a Markdown-supported DescriptionField. See: https://react-jsonschema-form.readthedocs.io/en/latest/advanced-customization/#custom-descriptions

Custom blocks

I'd rather see this provided as a plugin than as part of the core library. For example this can be done with custom spin on the ui:order property in object field templates.

I have done something similar here using just templating: https://codesandbox.io/s/0y7787xp0l

@epicfaace
Copy link
Member Author

Thanks @loganvolkers , that makes sense -- and once #1152 is merged, it will be easier to create custom FieldTemplates for each description.

@heath-freenome
Copy link
Member

With the 5.x implementation of the TitleFieldTemplate and DescriptionFieldTemplate adding Markdown should be very easy. Closing as this is a feature and a special use case that people can now easily implement themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is a feature request
Projects
None yet
Development

No branches or pull requests

4 participants