How best to have a dynamic component configuration UI?

I’m playing around with a state machine helper custom component and trying to figure out how best to handle dynamic user configuration input.

What I’d like is for the user to:

  1. Input a list of states:
    • solid
    • liquid
    • gas
  2. Select one of the states as initial:
    • liquid
  3. Input triggers and transitions, this is 3 inputs per entry and there can be any number of these.
    • melt, solid, liquid
    • freeze, liquid, solid
    • evaporate, liquid, gas
    • condense, gas, liquid
    • sublimate, solid, gas

My current approach is to:

  1. Have a single String input that I split on comma and turn that into the state list
  2. Show a drop down for the initial state picker (this works well)
  3. Show an input and two drop downs for the trigger, source, and dest and then a checkbox for “add more triggers”

Is there a better way to do these sorts of dynamic configuration UIs?