react icon indicating copy to clipboard operation
react copied to clipboard

Can we create new custom advance component in React-formio

Open vishaldenzil opened this issue 5 years ago • 2 comments

We need to give flexibility to user to create new components and save them so that it can be reused.

Like I drag textfield and a number field. Now user should be able to save this both as a combination of their custom field. and would be able to reuse it by simply drag and drop. So on drggging this newly saved component, form will render textfield and a number field together.

How is it possible with react-formio

vishaldenzil avatar Sep 27 '19 04:09 vishaldenzil

This is currently a feature that is in our backlog to make this easy to accomplish. We have built this into applications already though. The way to do this is to create a Resource called "Components" that will store the reusable components. Then have a mechanism (like a "Save as reusable" button) on the components so that you can save to the Components resource. This will store the json of the reusable components.

Then, in the form builder, you can provide an array of components to the Existing Resource Fields section of the builder and have them display there. Here is where that code currently is: https://github.com/formio/formio.js/blob/5c7f77f165297846e5fab0829f30b2fb2daa1c0a/src/WebformBuilder.js#L306-L330

A feature like this is going to take some development on either your part or ours to get working easily. Let us know if you have any more questions or would like to engage with support for help doing this.

randallknutson avatar Sep 27 '19 14:09 randallknutson

@vishaldenzil did you have any luck getting this working? I have client that wants to use the form builder to drag and drop groups of form fields that they frequently use. I think that is what you were trying to do, but I don't really understand from the example above how that would work.

nathancoates avatar May 04 '20 01:05 nathancoates

I am closing the issue as it was created too long ago and there are no new comments here. I hope it was resolved. If not, please reopen it. Thanks!

TanyaGashtold avatar Aug 31 '23 13:08 TanyaGashtold