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).
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"
}
]
}