
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
react-native-thumbnail-selector
Advanced tools
A simple thumbnail selector that opens and closes from the bottom of the screen.
Requires React-Native v0.43.0 or higher
Project began as an experiment with the new Flatlist in React-Native and shifted to a easy-to-use thumbnail selector module. Dedicated to OGs.
npm i react-native-thumbnail-selector --save
import ThumbnailSelector from 'react-native-thumbnail-selector'
//...
render() {
const items = [ // !!! Unique keys are required for Flatlist.
{ key: 0,
title: 'Lorem ipsum dolor sit amet',
borderColor: 'white',
imageUri: 'https://placeimg.com/125/125/any',
selected: true
},
{ key: 1,
title: 'Brian',
borderColor: 'white',
imageUri: 'https://facebook.github.io/react/img/logo_og.png',
selected: false
}
]
return (
<ThumbnailSelector
visible={this.state.visible}
items={items}
onSelectedItem={(item) => this.onSelectedItem(item)} />
)
}
// ...
toggleAction() {
this.setState({
visible: !this.state.visible
})
}
// ...
onSelectedItem(item) {
// ...
}
// ...
Name | Type | Description | Default |
---|---|---|---|
items | Required Array | Array of items (i.e.[{key: 0, title: 'Brian', borderColor: 'white', imageUri: 'https://facebook.github.io/react/img/logo_og.png', selected: false}] ) | [] |
visible | Bool | show or hide selector | false |
backgroundColor | String | backgroundColor of Flatlist | false |
flatlistProps | Func | <Flatlist /> props | null |
opacity | Number | unselected items opacity | 0.8 |
onSelectedItem | Func | Invoked when user selects an item | null |
closeOnSelect | Bool | whether or not to close after item is selected | true |
zIndex | Number | zIndex | 1000 |
closeOnSelectInterval | Number | duration of close animation | 200 |
numberOfLines | Number | numberOfLines for caption | 2 |
captionTextStyle | Text.proptypes.style | caption text style | {color: 'white', fontFamily: 'Avenir', fontSize: 16, textAlign: 'center'} |
thumbnailImageStyle | Image.proptypes.style | thumbnail image style | {width: 125, height: 125, borderWidth: 2, borderRadius: 2} |
containerStyle | View.proptypes.style | animated view style | {position: 'absolute', bottom: 0} |
itemContainerStyle | View.proptypes.style | item view style | {flexDirection: 'column', paddingLeft: 8, paddingRight: 8, paddingTop: 8, alignItems: 'center} |
FAQs
A thumbnail selector.
The npm package react-native-thumbnail-selector receives a total of 70 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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.