Provides similar functionality to heyday/silverstripe-colorpalette, but uses images rather than colours.
composer require iliain/silverstripe-visualfields
$fields->addFieldToTab('Root.Main', $typeField = VisualOptionField::create('IconType', 'Type', [
'icon-1' => $iconFolderPath . '/icon-1.png',
'icon-2' => $iconFolderPath . '/icon-2.png',
'icon-3' => $iconFolderPath . '/icon-3.png',
'icon-4' => $iconFolderPath . '/icon-4.png',
]));
You can customise the size and background colour of the images with the following options:
$typeField
->optionWidth('125px')
->optionHeight('125px')
->backgroundColour('#efe6da') // Only visible if the image has transparency
->imageSize('cover');