🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

react-native-spotlight-view

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-spotlight-view

Spotlight view for react native

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

react-native-spotlight-view npm version

Getting started

$ npm install react-native-spotlight-view --save

Example

alt text

Usage

import { SpotLight, SpotLightFromRef } from 'react-native-spotlight-view';

<SpotLight
  diameter={100}
  offsetX={100}
  offsetY={100}
  visible={true}>
  <View style={{ flex: 1 }}>
    {// Add any children here}
  </View>
</SpotLight>

Or

<SpotLightFromRef
  viewRef={someViewReference}
  visible={true}>
  <View style={{ flex: 1 }}>
    {// Add any children here}
  </View>
</SpotLightFromRef>

###Supported Props:

####For SpotLight

NameTypeDescription
durationnumber(optional)animation duration to show or hide in ms
visiblebooleanView visibility indicator
opacitynumber(optional) value between 0 to 1 for background opacity
diameternumberdiameter of spotlight view
offsetXnumberoffset from center of screen
offsetYnumberoffset from center of screen
circleImagenumber{ uri: string }
renderCirclefunction(style)(optional)function to render inner circle of spotlight
onRequestClosefunction()(optional)called when hardware back button is pressed on android

####For SpotLightFromRef

NameTypeDescription
durationnumber(optional)animation duration to show or hide in ms
visiblebooleanView visibility indicator
diameterOffsetnumber(optional)increase or decrease calculated diameter by this value
viewRefReact viewreact view reference to calculate offset
circleImagenumber{ uri: string }
opacitynumber(optional) value between 0 to 1 for background opacity
renderCirclefunction(style)(optional)function to render inner circle of spotlight
onRequestClosefunction()(optional)called when hardware back button is pressed on android

TroubleShooting

  • If on android using SpotLightFromRef, the spotlight is not showing then please ensure that on the reference view collapsible property is false
    i.e. collapsable={false}

Keywords

react-native

FAQs

Package last updated on 31 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts