Patterns

Safe Area

Screen edges can be obscured by system UI or device form. Explains criteria for deciding whether to place elements within the unobscured safe area or fill to the screen edge.

Safe Area cover image

Understanding Safe Area

Safe Area is an area on the screen that is not obscured or cut off by system UI or device form. Outside the safe area may be obscured or cut off by the following elements:

  • System UI that overlays on the screen, such as status bar or home indicator
  • Display cutout (area of the screen left empty for camera or sensors)
  • Rounded corners of the screen

A picture showing the area outside the safe area as a translucent plane in both portrait and landscape screens of the same device

The Four Sides Can Have Different Sizes

The safe area's insets are not limited to top and bottom.

  • Portrait: Safe area insets typically exist on the top and bottom, but depending on device form, insets can also appear on the left or right.
  • Landscape: Cameras or sensors can be placed on the left or right. On devices where the home indicator is displayed at the bottom, a bottom inset can also remain.

The insets of the four sides are independent of each other. Do not assume the top and bottom, or left and right, values are the same.

Sizes Vary by Situation

The size of the safe area can vary depending on the device, OS, screen orientation, and the display state of the system UI. The insets on all four sides can be 0, only some can be non-zero, or all can be non-zero.

Do not assume a specific direction is always 0, or apply a value confirmed for a specific device or situation as a fixed value across all screens.

It Can Also Change After the Screen Is Shown

The size or position of the safe area can change even while a screen is already displayed. For example:

  • When the size changes: In environments that support split screen, the area the app occupies on screen can change, causing each side's inset to shrink or disappear.
  • When the position changes: If the screen also rotates when the device is turned to the opposite orientation in landscape, the inset avoiding the camera can move to the opposite side.

So that content is not obscured even when the safe area changes due to screen rotation or splitting, always position elements based on the current safe area.

Placement Principles

Decide the placement range based on whether the element loses information or function when obscured or cut off. For scrollable elements, also check whether the obscured part can be brought into the safe area by scrolling.

Content Goes Inside the Safe Area

Pressable elements and content that would lose any information or function when obscured or cut off must be placed inside the safe area.

  • Pressable elements: buttons, links, input fields, tabs, etc.
  • Information that needs to be read: text, icons, prices, badges, images that convey meaning, etc.
A landscape screen where the list and the bottom-right Add Material FAB are placed inside the safe area, with the default margin secured between the FAB and the safe area boundary
Do
Place text and buttons inside the safe area.
A landscape screen where the list overlaps the camera, and the Add Material FAB, whose margin is measured from the screen edge, extends outside the right safe area
Don’t
If content is placed starting from the screen edge, it can overlap with the camera or home indicator.

Margins Are Measured from the Safe Area Boundary

The margin an element originally has is measured from the safe area boundary, not the screen edge. For example:

  • Left/right: Content that uses $dimension.spacing-x.global-gutter as the screen margin is offset by that amount from the safe area boundary.
  • Bottom: If a button is in a bottom fixed bar, offset the button from the bottom safe area boundary by the bar's inner padding.

If the margin is measured from the screen edge, content can be obscured wherever the safe area's inset is larger than the margin. Adding the default margin to the safe area's inset avoids obscuring content while keeping the default margin around content consistent even when the device or screen orientation changes.

A picture zooming into the left edge of a landscape screen, showing the $dimension.spacing-x.global-gutter between the safe area boundary and the content. The banner background extends to the screen edge.

Center Alignment Is Based on the Safe Area

Content placed inside the safe area is aligned based on the same safe area. For example, when centering search results below a search bar, align to the center of the safe area the search bar is placed in, not the entire screen. This way, even if an inset exists on only one side, the alignment reference of the search bar and the results stays consistent.

A screen with an inset on the right, where the No Results Result Section is centered between the search bar and the View All Materials button. The reference line above the results is the same length on both sides of the center.
Do
Align the search bar, search results, and bottom button based on the same safe area.
The search bar and the View All Materials button are inside the safe area, but only the No Results Result Section is centered on the screen and shifted to the right. The reference line above the results is shorter on the right of the center than on the left.
Don’t
If only the search results are centered on the entire screen, alignment with surrounding content is thrown off.

Backgrounds Extend to the Screen Edge

Elements that lose nothing when obscured or cut off fill all the way to the screen edge, beyond the safe area. If a background stops at the safe area, the area outside the safe area remains as an empty strip, making the screen look narrower, and elements that cross the screen look cut off in the middle.

  • Backgrounds of sections and banners such as Page Banner: fill to the left and right screen edges, but place the text and buttons inside them within the safe area.
  • Full-width Divider: fills to the left and right screen edges.
  • Images used decoratively, like hero images: fill to the left and right screen edges.
  • Maps, videos, full-screen image viewers: fill the background of the display area to the screen edge on all four sides. Decide the aspect ratio and cropping of the image or video itself according to the content's purpose.
A landscape screen where the Page Banner's background and the tab list extend to the left and right screen edges, and the banner text is inside the safe area
Do
Have the banner background and the tab's scroll area extend to the screen edge.
Empty strips remain on both sides of the Page Banner, and the tab list is cut off at the right safe area boundary
Don’t
Do not cut off the background and scroll area at the safe area boundary.

Content on Top of a Background

When a background and content are together in one element, apply the rule separately to each part. Fill the background to the screen edge, and place the content on top of it inside the safe area.

  • Buttons and text placed on top of an image: place them inside the safe area.
  • Text and main subjects contained within the image itself: compose the image so they fall inside the safe area. Place parts that are fine to obscure or cut off at the edges.
In an article screen, the staircase cover photo and white body background extend to the right edge, while the title, body text, and the expand button at the bottom right of the photo are placed avoiding the right inset shown in red
Do
Fill the cover image and body background to the screen edge, and keep the text and expand button inside the safe area.
In the same article screen, the text and expand button are placed based on the screen edge, causing the right part of the body text and the button at the bottom right of the photo to overlap the right inset shown in red
Don’t
Do not extend the placement range of the text and buttons to the screen edge along with the background.

Even after scrolling until the cover image is no longer visible, the body text must remain inside the safe area.

A zoomed-in view of the top of an article scrolled until the cover disappears. The body text wraps to avoid the right safe area and is visible to the end of the sentence.
Do
Make sure the body text is still readable, avoiding the camera and system indicator, even after scrolling.
A zoomed-in view of the top of the same article scrolled. The text continuing to the right is hidden behind the camera and system indicator.
Don’t
If the body text extends all the way to the screen edge, the characters are obscured by the camera and system indicator.

Scrollable Content

Scrollable items can pass outside the safe area while scrolling. If an obscured item can be scrolled back into the safe area, no information or function is lost, so the scroll area is widened to the screen edge. If the scroll area is cut off at the safe area, items appear cut off inside the screen.

  • Horizontal scroll: Tabs, chip lists, and carousels extend past the left and right safe area to the screen edge.
  • Vertical scroll: lists extend to the bottom edge of the screen. In environments with a bottom inset, items can pass outside the safe area while scrolling.

In this case, observe the following conditions.

  • When not scrolled, align the first item to the same line as other content. For example, if other content uses $dimension.spacing-x.global-gutter as the screen margin, offset the first item of the horizontal scroll by that same amount from the safe area boundary.
  • Only the scroll area is widened to the screen edge. Buttons and bars fixed on screen cannot be brought back by scrolling, so keep them inside the safe area.

A before-and-after scroll comparison of the same landscape screen with the Reference Videos tab selected. Before scrolling, the first tab starts inside the left safe area; after scrolling to the end, the right inset and default margin remain after the last tab, Collected Stickers.

A zoomed-in view of the bottom of a portrait screen. List items continue below the safe area boundary shown by the dotted line.
Do
Have the list extend past the bottom safe area to the screen edge.
At the same scroll position, the list's text is cut off at the dotted safe area boundary line, and an empty space remains below it
Don’t
Do not cut off the scroll area at the bottom safe area boundary.

When scrolled all the way to the end, the entire last item must be visible inside the safe area. Secure both the safe area inset and the default margin together at the end of the scroll content.

The bottom of a list scrolled to the end. The title, secondary text, and arrow of the last Reading List row are all above the safe area boundary, and a margin remains below the row as well.
Do
When scrolled to the end, keep the last item and the default margin inside the safe area.
A list scrolled to the end with no bottom margin. The secondary text and arrow of the last Reading List row are caught on the safe area boundary and remain in the home indicator area.
Don’t
Make sure the last item does not remain outside the safe area even when scrolled to the end.

Table of contents