Icon Based Selection

This component lets you pick a specific value based on a set of icons. You could control which values and icons are available through simple yaml definition.

 

Customizing

You'll find the Icon Based Selection in webresources\jsFields. Feel free to modify it to your needs.

If you want to add or remove some of the icon choices you can add and remove them within the dialog definition.

alignment:
  label: "Alignment"
  $type: javascriptField
  height: 45
  fieldScript: /magnolia-central-module/webresources/jsFields/iconSelector.html
  parameters:
    1_align-left:
      name: "align-left"
      value: "text-start"
      label: "Align left"
      icon: "/.resources/magnolia-central-module/webresources/icons/align-left.svg"
    2_align-center:
      name: "align-center"
      value: "text-center"
      label: "Align center"
      icon: "/.resources/magnolia-central-module/webresources/icons/align-center.svg"
    3_align-right:
      name: "align-right"
      value: "text-end"
      label: "Align right"
      icon: "/.resources/magnolia-central-module/webresources/icons/align-right.svg"