Restrict Sources on element select field I'm building a module with a form that includes an element select field that I want to restrict to specific volume. So far this is what I have:

{{ forms.elementSelectField({
    label: "Asset"|t('app'),
    id: 'images', 
    name: 'images',
    elementType: 'craft\\elements\\Asset',
    selectionLabel: "Choose"|t('app'),
    criteria: {
        kind: ['images']
    },
}) }}


I can see there is a 'sources' attribute, but I don't know how to structure the value. I've tried:

sources:[1] and the handle sources:['images'] without luck.
I am not expert in Craft CMS but this is how it works for me:

Depending on the element type, source is different.

Look at this link how Craft CMS implements this:

https://github.com/craftcms/cms/blob/60881865f1b680c5aa5d4ad8f56d9a1ce3e452b0/src/fields/BaseRelationField.php#L842

Now how assets implement inputsource function:

https://github.com/craftcms/cms/blob/f83815cf28e7ce91edd501fc55ffd10f915a808e/src/fields/Assets.php#L550

so the format of sources for asset is like:

['folder:uid in volumefolders table']


and you can easily limit user to select assets from volumes you want.