Skip to content
Gravity Logo / Docs Gravity home
Browse documentation
Documentation/Gravity Native

View

The <ViewContainer> component is a wrapper for all of your views – you should render all of your content inside of this.

Warning

Be careful not to confuse this component with React Native’s built-in View component; which is a generic wrapper for rendering elements on screen.

The <ViewContainer> houses common components that are present throughout your app, like the status bar, header and banner notification.

<ViewContainer header scrollable>
 {/* Screen content */}
</ViewContainer>

Props

PropDescriptionRequiredValue
avoidKeyboardensure inputs remain visible when the keyboard is openoptionalboolean
childrencustom viewrequiredcomponent
headertoggles a header section with title and nav buttonoptionalboolean
justifyaligns the content in the centre of the viewoptionalboolean
logoshows a logo mark in the header sectionoptionalboolean
loadingshow the loading spinneroptionalboolean
onRefreshcallback function when pulling to refreshoptionalfunction
refreshingonRefresh is in progressoptionalfunction
scrollableenable scrollingoptionalboolean

User Permissions

Screen registration and role-based navigation belong in the router. ViewContainer renders the screen content and banner.