Can you register a component with multiple prop choice strings?

Is it possible to register a component with multiple prop types? (i.e., it could be a choice ‘a’, ‘b’, ‘c’, or any other string?

Hi, yes you should be able to use {type: 'choice', options: ['a','b','c']} - does that help?

https://docs.plasmic.app/learn/registering-code-components/

https://docs.plasmic.app/learn/code-components-ref/

I also want to allow them to do free text as well. So I would expect something like this:

PLASMIC.registerComponent(Button, {
  name: 'Button',
  props: {
    variant: [
      {
        type: 'choice',
        options: ['contained', 'outlined', 'text']
      },
      {
        type: 'string'
      }
    ],
  }
});

Hi Chris, unfortunately not yet - relaying your feedback to the team.

However, for now as a workaround, you could have two different props. You could even conditionally show/hide the second free-input prop based on the choice of the first one, which gives the same effective UI.