Customize Array control to render UIKit accordion

Hi group,

I am looking to customize the Array Control to render it’s elements as an UIKit accordion (UIkit) in a vue3 app. I keep getting a runtime error and would like to pick your brains about it.

Here’s my thinking:

  • I am creating a VUE app and get jsonforms, jsonforms-vue and jsonforms-vue-vanilla up and running in v3.0.0-beta.5
  • I define custom styles and have them applied to match the rest of my UIKit app interface
  • I copy the Array control into my components, customize it as needed, add it to the render registry
  • BAM! Customized jsonforms in the blink of an eye

We all know this did not happen as planned. So here’s what I have so far:

  • I copied the ArrayListRenderer.vue and ArrayListElement.vue from vue-vanilla (jsonforms/packages/vue/vue-vanilla/src/array at master · eclipsesource/jsonforms · GitHub) to my components folder
  • I adapted the import paths
  • I adapted the templates to reflect the structure of the accordion (see below)
  • I import the renderer component into my view and add it to the vanilla renderers, and added all renderers to the data attribute of my SFC to use it in the template (see below)

ArrayListRenderer.vue - template

  <fieldset v-if="control.visible" :class="styles.arrayList.root">
    <legend :class="styles.arrayList.legend">
      <label :class="styles.arrayList.label">
        {{ control.label }}
    <ul uk-accordion="multiple: true">
        :moveUp="moveUp(control.path, index)"
        :moveUpEnabled="index > 0"
        :moveDown="moveDown(control.path, index)"
        :moveDownEnabled="index < - 1"
        :delete="removeItems(control.path, [index])"
        v-for="(element, index) in"
          :path="composePaths(control.path, `${index}`)"
    <div v-if="noData" :class="styles.arrayList.noData">No data</div>

ArrayListElement.vue - template

  <div :class="styles.arrayList.item">
    <div @click="expandClicked" :class="toolbarClasses">
      <div :class="styles.arrayList.itemLabel">{{ label }}</div>
    <div :class="contentClasses">

Adding ArrayListRenderer to VanillaRenderer

import { vanillaRenderers } from "@jsonforms/vue-vanilla";

import ArrayListRenderer from "@/components/jsonforms/ArrayListRenderer.vue";

const jfRenderers = Object.freeze(vanillaRenderers);

data() {
    return {
      form: null,
      editform: false,
      data: null,

I can serve the app, but when I render the form I get this error message in the console, and the form doesn’t render:

Since I haven’t modified any of the defineComponent()-code, I don’t understand how I can get this error. jsonforms is running with no errors without my custom control, so I excluded a beta-issue for now.

Thanks for all your help!

So, it was all there in the FAQ :confused: Just needed to be more focused. I will document it here for others since the official documentation is react-focused. (Maybe this example will find its way into the official docu for vue-folks like me).

The Renderer has two exports:

  • default = Component
  • entry = RendererRegistryEntry holding the component and the tester

Since the registry entry needs both, the component and the tester, the Import into my View needed a simple change (see below).


import { entry as ArrayListRenderer } from "@/components/jsonforms/ArrayListRenderer.vue";

All that‘s left now is to set the rank to 3, so the custom renderer is always picked instead of the default vanillaRenderer.

1 Like

Hi @kimamil,

Thanks for the great write up! Glad that you were able to fix it yourself!