Skip to content

Custom array component #1196

Answered by radekmie
Zetra416 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Zetra416. There are two things here:

  1. To have a multi-select, your schema has to accept multiple values. That means, it has to be an array of strings, not a single string:
    option: {
      type: "array",
      uniforms: {
        options: [
          { label: "Option A", value: "a" },
          { label: "Option B", value: "b" },
        ],
      },
      items: { type: "string" },
    },
  2. The above code will use a multi-select out of the box. If you'd like to provide your own custom component, then follow this guide.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by radekmie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants