PrimeFlex provides various spacing utilities to modify an element's layout.
The classes modify the margins and use the p-m{position}-{value} syntax whereas for responsive values p-m{position}-{breakpoint}-{value} format is used.
<div class="p-mb-2"></i> <div class="p-mt-4"></i> <div class="p-m-1 p-m-lg-2"></i>
Position can either be either of the 4 sides, the x-y axis or blank for the shortand of all sides.
Value field varies from 0 to 6 where default value of the $spacer is 1rem. The special auto value is used to center elements using auto margins.
Breakpoints define how the spacing should be depending on the screen size.
Spacing is a handy utility when elements wrap when screen size get smaller. In example below, when buttons wrap they are displayed on top of each other whereas with spacing this issue can easily be resolved.
Spacing utilities also work seamlessly with responsive PrimeFlex grid utilty. Example below demonstrates a case where on a smaller screen inputs receive a margin to position themselves separately in stacked mode, reduce the dimension of the window to view the difference.