Dimension

The Dimension field comes in handy when allowing users the ability to set the width, height and unit value of any HTML element that supports those properties.

dimension

or

dimension-height

Attributes

AttributesTypeRequiredDescription
idstringRequiredRequired. Unique ID identifying the field. It will be used as meta_key. Must be different from all other field IDs.
titlestringRequiredDisplays title of the option.
subtitlestringOptionalSubtitle display of the option, situated beneath the title.
descstringOptionalDescription of the option, appearing beneath the field control.
typestringRequiredValue identifying the field type. For Dimension field here we set value dimension
defaultarrayOptionalArray of default values. See ‘Default Options’ below.
colintOptionalThe proportion of columns that display field on 12 columns per row.
heightboolOptionalFlag to display the height input. Defaul value is true
widthboolOptionalFlag to display the width input. Defaul value is true

Default Options

NameTypeDescription
widthstringDefault width value to display.
heightstringDefault height value to display.

 Example Declaration