The Unit field holds a number with its unit: a width, a font size, a gap.

Configuration
Go to Modern Fields > Fields groups and add the Unit field. Its settings are in the inspector:
| Effect | |
|---|---|
| Units | The units offered: px, em, rem, vw, vh and % by default. |
| Minimum value | The lowest number allowed. |
| Maximum value | The highest number allowed. |
| Step | The increment step of the field. 1 by default. |
Display the value
The field stores the number and its unit together, such as 20px or 1.5rem: the value is ready to use in CSS. Read it with get_field():