--- id: slds.guidance.utilities.padding title: Padding Utilities description: SLDS padding utility classes for internal spacing summary: "Utilities for internal spacing within elements. Includes directional variants, size scale from xxx-small to xx-large, and variable density classes." artifact_type: reference domain: utilities topic: padding content_format: structured complexity: intermediate audience: [implementer] tasks: [implement] refs: - slds.guidance.utilities - slds.guidance.overview.utilities - slds.guidance.utilities.margin - slds.guidance.hooks.spacing tags: [utilities, padding, spacing, internal-spacing] keywords: [slds-p, slds-p-around, slds-p-horizontal, slds-p-vertical, padding] --- # Padding - Internal Spacing Internal spacing within elements. Base unit: **4px**. ## Size Scale | Size | Token | Value | Pixels | |------|-------|-------|--------| | `none` | 0 | 0 | 0px | | `xxx-small` | `--slds-g-spacing-1` | 0.125rem | 2px | | `xx-small` | `--slds-g-spacing-2` | 0.25rem | 4px | | `x-small` | `--slds-g-spacing-3` | 0.5rem | 8px | | `small` | `--slds-g-spacing-4` | 0.75rem | 12px | | `medium` | `--slds-g-spacing-5` | 1rem | 16px | | `large` | `--slds-g-spacing-6` | 1.5rem | 24px | | `x-large` | `--slds-g-spacing-7` | 2rem | 32px | | `xx-large` | `--slds-g-spacing-8` | 3rem | 48px | ## Core Classes ### Directional Padding | Class | Purpose | |-------|---------| | `slds-p-top_*` | Applies padding to element's top edge | | `slds-p-right_*` | Applies padding to element's right edge | | `slds-p-bottom_*` | Applies padding to element's bottom edge | | `slds-p-left_*` | Applies padding to element's left edge | | `slds-p-horizontal_*` | Applies padding to left and right edges | | `slds-p-vertical_*` | Applies padding to top and bottom edges | | `slds-p-around_*` | Applies padding to all four edges | ### Special Classes | Class | Purpose | |-------|---------| | `slds-has-cushion` | Applies default padding of 12px (small) to all sides | ## Common Patterns ```html