Screen

Layout

A SafeAreaView wrapper that handles safe area insets, keyboard avoidance, and optional scroll behaviour for full-screen layouts.

GitHub

Installation

bash
1
npx native-mate add screen

Examples

#FAFAFA
Radius100%

Usage

tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { Screen } from '~/components/ui/screen'

// Basic full-screen wrapper
<Screen>
  <YourContent />
</Screen>

// Scrollable screen
<Screen scroll>
  <LongFormContent />
</Screen>

// Custom edges (e.g. tab screen — no top inset)
<Screen edges={['bottom']} style={{ paddingHorizontal: 16 }}>
  <TabContent />
</Screen>

Props

PropTypeDefaultDescription
childrenReact.ReactNodeScreen content.
scrollbooleanfalseWraps content in a ScrollView for scrollable screens.
keyboardAwarebooleantrueAdjusts layout when the software keyboard appears.
styleViewStyleAdditional styles applied to the inner content container.
edgesArray<"top" | "bottom" | "left" | "right">["top","bottom"]Which safe area edges to apply insets for.

Example

tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { Screen } from '~/components/ui/screen'
import { Text } from '@native-mate/core'
import { View } from 'react-native'

export function ProfileScreen() {
  return (
    <Screen scroll style={{ paddingHorizontal: 16 }}>
      <View style={{ paddingTop: 24, gap: 16 }}>
        <Text size="2xl" weight="bold">Profile</Text>
        <Text color="muted">Manage your account settings and preferences.</Text>
        {/* profile fields */}
      </View>
    </Screen>
  )
}