Import
Basic Usage
Props
View inherits all props from accessibility and gesture responder handlers.Layout Props
Styles to apply to the view. Supports all flexbox, transform, and layout properties.
Child components to render inside the view.
Behavior Props
Views that are only used to layout their children or otherwise don’t draw anything may be automatically removed from the native hierarchy as an optimization. Set this property to
false to disable this optimization and ensure that this View exists in the native view hierarchy.Setting to false prevents direct children of the view from being removed from the native view hierarchy, similar to the effect of setting
collapsable={false} on each child.This is a special performance property exposed by RCTView and is useful for scrolling content when there are many subviews, most of which are offscreen. For this property to be effective, it must be applied to a view that contains many subviews that extend outside its bound.
Controls whether the View can be the target of touch events.
auto- The View can be the target of touch eventsnone- The View is never the target of touch eventsbox-none- The View is never the target of touch events but its subviews can bebox-only- The View can be the target of touch events but its subviews cannot be
Identification Props
Used to locate this view from native classes. Has precedence over
nativeID prop.Used to locate this view from native classes.
Used to locate this view in end-to-end tests.
Touch Props
This defines how far a touch event can start away from the view. Typical interface guidelines recommend touch targets that are at least 30 - 40 points/density-independent pixels.
Whether this View needs to rendered offscreen and composited with an alpha in order to preserve 100% correct colors and blending behavior.
Event Handlers
Invoked on mount and layout changes with
{nativeEvent: { layout: {x, y, width, height}}}. This event is fired immediately once the layout has been calculated.Android Props
- Android
- iOS
Whether this View should render itself (and all of its children) into a single hardware texture on the GPU.
Whether this View should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard.
Indicates whether this View should be focusable with a non-touch input device.
0- View is focusable-1- View is not focusable
TV next focus down.
TV next focus forward.
TV next focus left.
TV next focus right.
TV next focus up.