Question about documentation

Sorry if this is obvious - in the documentation such as the properties for an image component, the properties are listed, but I don’t see where valid values are specified. For example, the image property for display_mode, the documentation just says “string.” Same for many of the properties, is this referring to some standard I then need to refer to?

The property for width says ‘default’ but, “default” is an invalid value

1 Like

I think you’re right - it’s like this issue in the border syntax

Component property: border: what are its valid values?

Luckily for the particular issue with the image component anvil has a dropdown of allowed values for display-mode

Screen Shot 2020-02-13 at 09.40.17

for the width self.image_1.width = "default" works for me

Other valid values are basically anything css like
https://www.w3schools.com/cssref/css_units.asp

so "50%", "300px", "auto", "80vw"

I think anvil will allow any string and if it isn’t valid then it will default to default so

self.image_1.width = "blah" is parsed but ignored

1 Like