--- id: slds.guidance.utilities.layout title: Layout Utilities description: SLDS layout utility classes for global spacing and component connection summary: "Utilities for global spacing (has-buffer, has-full-bleed, magnet utilities). Provides consistent buffer margins, full-bleed layouts, and seamless card connections." artifact_type: reference domain: utilities topic: layout content_format: structured complexity: intermediate audience: [implementer] tasks: [implement] refs: - slds.guidance.utilities - slds.guidance.overview.utilities - slds.guidance.hooks.spacing tags: [utilities, layout, spacing, magnet] keywords: [slds-has-buffer, slds-has-full-bleed, slds-has-magnet] --- # Layout - Global Spacing & Component Connection Global spacing management and seamless component connections. ## Core Classes | Class | Purpose | |-------|---------| | `slds-has-buffer` | Applies consistent global margin using `--slds-g-spacing-3` token | | `slds-has-full-bleed` | Removes all margins to create full-bleed layouts | | `slds-has-bottom-magnet` | Removes bottom margin and border radius to connect with element below | | `slds-has-top-magnet` | Removes top margin and border radius to connect with element above | ## Common Patterns ### Standard Buffer Spacing ```html
Card with buffer margin
Content has global spacing on all sides
``` ### Full-Bleed Hero Section ```html
Full-width header with no margins
``` ### Connected Card Components ```html
First Card
This card connects to the one below
Second Card
Appears seamlessly connected to card above
``` ### Multiple Connected Components ```html

Section Header

Middle card connected on both sides

Footer content

``` ### Combined Buffer and Magnet ```html
Card with side margins but connected below
Connected card with modified buffer behavior
``` ## Best Practices ✅ Use `slds-has-buffer` on cards and boxes for consistent component spacing ✅ Apply magnet utilities to Cards, Page Headers, and Box components ✅ Use `slds-has-bottom-magnet` on the top component and `slds-has-top-magnet` on the bottom component ✅ Use `slds-has-full-bleed` for hero sections and full-width backgrounds ❌ Avoid using magnet utilities on non-card-like elements ❌ Do not mix magnet utilities with custom margin styles ❌ Never apply `slds-has-full-bleed` to components that need spacing ❌ Do not use magnet utilities when visual separation is needed