Skip to main content

View

All upstream props work as documented in the React Native View reference. This page lists only what desktop adds or changes.

Desktop props​

NameTypeBehaviour
desktopDragRegionbooleanMarks the view as part of a custom title bar: pressing it drags the window and double-clicking zooms or maximizes it. See Title bar.
focusablebooleanLets the view take keyboard focus. Required to receive onKeyDown, onKeyUp, onFocus and onBlur.
onFocus, onBlur(event) => voidThe view gained or lost keyboard focus. focusVisible is true when focus arrived through the keyboard. A focused view shows a ring for keyboard users, except a TextInput and a view that sets its own outlineColor and outlineWidth.
onKeyDown, onKeyUp(event: KeyEvent) => voidA key was pressed or released while the view has focus. The event has key, code, keyCode, repeat and the modifier flags.
onContextMenu(event: DesktopContextMenuEvent) => voidA context menu was requested: right click, Control + click on macOS, or the Menu key or Shift + F10 on Windows and Linux. See Context menus.
onPointerDown, onPointerUp, onPointerMove, onPointerEnter, onPointerLeave, onPointerOver, onPointerOut, onPointerCancel(event: PointerEvent) => voidThe pointer events of the web, for the mouse and trackpad, including buttons other than the left one and hovering. Each has a capturing variant. See Mouse and keyboard input.
tabIndexnumberIncludes the view in, or excludes it from, keyboard tab navigation.

Differences​

  • On desktop a View with children and an opacity below 1 is painted into a picture of its own and faded, as on iOS and Android. needsOffscreenAlphaCompositing has no effect.
  • hitSlop extends the area that starts a press. Hover and pointer moves are over the view itself, and an ancestor with overflow: 'hidden' clips the slop.
  • Mobile-only accessibility props that name VoiceOver gestures work through the platform accessibility tree on each OS. Screen readers on Windows and Linux have not been validated.