# Spacing
Update your layout without creating new classes. Spacing helpers are useful for modifying the padding and margin of an element.
Use the playground to get a feel for what the different helper classes can do. For an explanation of how they work, see the How it works section below.
# How it works
The helper classes apply margin or padding to an element ranging from 0 to 16. Each size increment was designed to align with common Material Design spacings. These classes can be applied using the following format {property}{direction}-{size}.
The property applies the type of spacing:
m- appliesmarginp- appliespadding
The direction designates the side the property applies to:
t- applies the spacing formargin-topandpadding-topb- applies the spacing formargin-bottomandpadding-bottoml- applies the spacing formargin-leftandpadding-leftr- applies the spacing formargin-rightandpadding-rights- applies the spacing formargin-left/padding-left(in LTR mode) andmargin-right/padding-right(in RTL mode)e- applies the spacing formargin-right/padding-right(in LTR mode) andmargin-left/padding-left(in RTL mode)x- applies the spacing for both*-leftand*-righty- applies the spacing for both*-topand*-bottoma- applies the spacing for the property in all directions
The size controls the increment of the property in 4px intervals:
0- eliminates allmarginorpaddingby setting it to01- setsmarginorpaddingto 4px2- setsmarginorpaddingto 8px3- setsmarginorpaddingto 12px4- setsmarginorpaddingto 16px5- setsmarginorpaddingto 20px6- setsmarginorpaddingto 24px7- setsmarginorpaddingto 28px8- setsmarginorpaddingto 32px9- setsmarginorpaddingto 36px10- setsmarginorpaddingto 40px11- setsmarginorpaddingto 44px12- setsmarginorpaddingto 48px13- setsmarginorpaddingto 52px14- setsmarginorpaddingto 56px15- setsmarginorpaddingto 60px16- setsmarginorpaddingto 64pxn1- setsmarginto -4pxn2- setsmarginto -8pxn3- setsmarginto -12pxn4- setsmarginto -16pxn5- setsmarginto -20pxn6- setsmarginto -24pxn7- setsmarginto -28pxn8- setsmarginto -32pxn9- setsmarginto -36pxn10- setsmarginto -40pxn11- setsmarginto -44pxn12- setsmarginto -48pxn13- setsmarginto -52pxn14- setsmarginto -56pxn15- setsmarginto -60pxn16- setsmarginto -64pxauto- sets the spacing to auto
# Examples
# Breakpoints
Vuetify comes with a 12 point grid system built using Flexbox. Spacing is used to create specific layouts within an application’s content. It consists of 5 media breakpoints used to target specific screen sizes or orientations: xs, sm, md, lg and xl. The default resolutions are defined below in the Viewport Breakpoints table and can be modified by customizing the breakpoint service config.
| Device | Code | Type | Range |
|---|---|---|---|
| Extra small | xs | Small to large phone | < 600px |
| Small | sm | Small to medium tablet | 600px > < 960px |
| Medium | md | Large tablet to laptop | 960px > < 1264px* |
| Large | lg | Desktop | 1264px > < 1904px* |
| Extra large | xl | 4k and ultra-wide | > 1904px* |
| * -16px on desktop for browser scrollbar | |||
| Specification | |||
The helper classes apply margin or padding at a given breakpoint. These classes can be applied using the following format: {property}{direction}-{breakpoint}-{size}. This does not apply to xs as it is inferred; e.g. ma-xs-2 equals ma-2.
# Horizontal
Using the margin helper classes you can easily center content horizontally.
# Negative margin
Margin can also be applied negatively at the same 1 to 16 intervals.