Feature request: Radio button toggle for plug-ins settings

It would be great if the plug-in’s settings screen could be extended with a new type "selection".

Users of my plug-in Photos page can choose between two layouts. Currently, I’ve implemented this choice as a text input field. It works alright but isn’t ideal. Primarily since it opens up scenarios where the user can enter values that aren’t supported by the plug-in.

Instead, I propose a new type "selection" that can be used for these kind of selections. This type could be rendered as a Radio button toggle (and maybe a extended with toggle to render as checkboxes if Micro.blog wants to support entering multiple values).

Skärmavbild 2022-06-26 kl. 16.43.12

And finally, a suggestion on how this field could be represented within ./plugin.json:

{
  "field": "params.layout_style",
  "label": "Select your preferred style",
  "type": "selection",
  "options": [
    {
      "value": "grid",
      "label": "Flexible Grid with fixed height"
    },
    {
      "value": "masonry",
      "label": "Masonry layout with flexible height"
    }
  ]
}
1 Like

I think this is a great idea. My gut says maybe type = “list” would be better? Not sure. Naming things is always the hardest part. :slightly_smiling_face:

type = "list" would work just as fine!