SwiftUI.js
Components

SafeAreaInset

SafeAreaInset adapts SwiftUI's `.safeAreaInset` modifier into an explicit layout container for the web.

SafeAreaInset adapts SwiftUI's `.safeAreaInset` modifier into an explicit layout container for the web.

Examples

Bottom

Preview unavailable for this example in the static docs build.

Show code
<SafeAreaInset edge="bottom" inset={<Button>Compose</Button>}>
      <div style={{ padding: 16, border: '1px solid var(--sw-color-gray-4, #d1d5db)', borderRadius: 16 }}>
        Mail list
      </div>
    </SafeAreaInset>

Variants

Preview unavailable for this example in the static docs build.

Show code
<SafeAreaInset edge="top" inset={<div style={{ padding: 12 }}>Now playing</div>}>
      <div style={{ padding: 16, border: '1px solid var(--sw-color-gray-4, #d1d5db)', borderRadius: 16 }}>
        Library content
      </div>
    </SafeAreaInset>

API

PropTypeRequiredDescription
edge'top' | 'bottom' | 'leading' | 'trailing'NoNo description yet.
insetReactNodeYesNo description yet.

Inherits additional props from IBaseComponent.

Overview

SafeAreaInset adapts SwiftUI's .safeAreaInset modifier into an explicit layout container for the web.

On this page