
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
react-native-thumbnail-selector
Advanced tools
yarn add react-native-thumbnail-selector
npm install react-native-thumbnail-selector --save
This depends on React hooks introduced in React v16.8.0 and uses useWindowDimensions
introduced in react-native v0.61.0.
Import import ThumbnailSelector from 'react-native-thumbnail-selector';
Create an array of object(s) that have image and caption properties. Example:
const thumbnails = [
{image: 'https://reactnative.dev/docs/assets/favicon.png', caption: 'React-native'},
{image: 'https://placeimg.com/125/125/any', caption: 'Any'},
];
Add ThumbnailSelector
component and allocate ref.
let thumbnailSelectorRef = useRef();
<ThumbnailSelector
ref={thumbnailSelectorRef}
thumbnails={thumbnails}
/>
Then to show or hide it use: thumbnailSelectorRef.current.animate();
.
Name | Type | Description | Default |
---|---|---|---|
thumbnails | Array | thumbnails for the Flatlist | [] |
renderThumbnail | Function | render the thumbnails | undefined |
onThumbnailSelect | Function | invoked at thumbnail selection | () => {} |
initialIndex | Number | the index that is selected initially | -1 |
horizontal | Boolean | thumbnail stack position | true |
active | Object | opacity and border color for thumbnail when selected | { opacity: 1, borderColor: 'black' } |
inactive | Object | opacity and border color for thumbnail when not selected | { opacity: 0.5, borderColor: 'transparent' } |
thumbnailProps | Object | props passed to Image component | { style: { width: 125, height: 125, borderWidth: 2 } } |
captionProps | Object | props passed to Text component | {style: {fontSize: 16, textAlign: 'center'}} |
buttonProps | Object | props passed to TouchableOpacity component | {style: {flexDirection: 'column', padding: 8}} |
animatedViewStyle | Object | style for Animated.View | { elevation: 1, zIndex: 1,position: 'absolute', top: 0, left: 0, right: 0 } |
animationConfig | Object | style for Animated.SpringAnimationConfig | { toValue: 0, duration: 600, friction: 9, useNativeDriver: true } |
FAQs
A thumbnail selector.
The npm package react-native-thumbnail-selector receives a total of 58 weekly downloads. As such, react-native-thumbnail-selector popularity was classified as not popular.
We found that react-native-thumbnail-selector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.