For the complete documentation index, see llms.txt. This page is also available as Markdown.

Mobile Safe Area

Where scene UI can safely live on mobile — clear of the system HUD and the device's hardware-reserved margins.

On a phone, two things eat into the screen space your UI can safely use:

  • The Decentraland system HUD — the app overlays its own controls (joystick, chat, profile, camera controls, the interaction button). Scene UI placed under them clashes visually and competes for taps. These regions are mapped out in Reserved margins below.

  • The device's hardware-reserved margins — the notch or camera cutout, status bar, home indicator, and rounded corners. The SDK keeps UI clear of these automatically with the ScreenInsetArea component.

The mobile safe area is what's left over — where scene UI can live without clashing with either.

All values below use normalized coordinates [0.0 – 1.0] based on a 1600 × 720 px landscape reference resolution. Always use normalized values so your layout adapts to any screen size. Always verify on a real device using the preview QR code.

Reserved margins

The system HUD occupies the outer edges on all four sides. Do not place scene UI inside these regions:

Edge
Reserved for
Size

Left

Chat, joystick, emotes

480 px — 30% of width

Right

Profile, action buttons

400 px — 25% of width

Top

System bar

58 px — 8% of height

Bottom

System bar

58 px — 8% of height

// Minimum safe insets (normalized)
margin: { left: 0.30, right: 0.25, top: 0.08, bottom: 0.08 }
Mobile screen with the reserved regions highlighted
Reserved regions on the mobile client: left side, top-right, and bottom-right are owned by system controls.

Center safe zone

The recommended area for all scene UI is the center band of the screen. It gives you 720 × 605 px of usable space:

Pixels
Normalized

x start

480 px

0.30

x end

1200 px

0.75

y start

58 px

0.08

y end

662 px

0.92

Mobile screen with the safe area highlighted
The center safe zone: 720 × 605 px, from x 30%–75% and y 8%–92%.

Right-side gap (small elements only)

Between the Profile avatar (top-right) and the action button cluster (bottom-right) there is a narrow gap where small UI elements — icons, counters, status indicators — can live. Keep elements here to a maximum of 48 × 48 px to avoid crowding the controls.

Pixels
Normalized

x range

1200 – 1600 px

0.75 – 1.0

y range

158 – 360 px

0.22 – 0.50

Where to put scene UI

  • Center of screen — actionable dialogs, anything the player needs to read and respond to.

  • Top-center — non-actionable messages, status, and notifications.

  • Center-bottom (above the interaction button) — context-sensitive hints.

  • Right-side gap — small icons or counters only (max 48 × 48 px).

Why it matters

Scene UI that overlaps the reserved regions will:

  • Be partially hidden behind the joystick, interaction button, or camera controls.

  • Compete for taps with the system controls — players will accidentally trigger one or the other.

  • Make your scene feel broken on mobile, which hurts featuring and retention.

Device hardware insets (ScreenInsetArea)

The reserved margins above belong to the Decentraland system HUD. Separately, the device hardware reserves screen space for the notch or camera cutout, the status bar, the home indicator, and rounded corners. UI drawn underneath these is partly hidden or hard to tap.

The ScreenInsetArea component keeps your UI clear of these hardware margins automatically, reading the current insets the device reports. Import it from @dcl/sdk/react-ecs and wrap the UI you want to protect:

ScreenInsetArea positions itself absolutely using the inset values the device reports, so the positionType and position fields of its uiTransform are reserved — any value you set for them is ignored. All other uiTransform properties (padding, flexDirection, alignItems, …) and UI components (uiBackground, onMouseDown, …) work as usual. The component reacts automatically when the insets change, for example on rotation or when system bars appear or hide.

📱 Mobile only: ScreenInsetArea only changes anything on the mobile client, where the device reports real inset values. On the desktop client the insets are (0, 0, 0, 0), so the component has no effect and your UI renders exactly as it would without it. It's safe to leave in cross-platform UI code.

Last updated