You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-native-thumbnail-selector

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-thumbnail-selector

A simple thumbnail selector that opens and closes from the bottom of the screen.

1.0.0
Source
npmnpm
Version published
Weekly downloads
84
6.33%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-thumbnail-selector

Platform npm version npm version License

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.

Installation

npm i react-native-thumbnail-selector --save

Usage

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) {
	// ...
}
// ...

Demo

screenshot

Props

NameTypeDescriptionDefault
itemsRequired ArrayArray of items (i.e.[{key: 0, title: 'Brian', borderColor: 'white', imageUri: 'https://facebook.github.io/react/img/logo_og.png', selected: false}])[]
visibleBoolshow or hide selectorfalse
backgroundColorStringbackgroundColor of Flatlistfalse
flatlistPropsFunc<Flatlist /> propsnull
opacityNumberunselected items opacity0.8
onSelectedItemFuncInvoked when user selects an itemnull
closeOnSelectBoolwhether or not to close after item is selectedtrue
zIndexNumberzIndex1000
closeOnSelectIntervalNumberduration of close animation200
numberOfLinesNumbernumberOfLines for caption2
captionTextStyleText.proptypes.stylecaption text style{color: 'white', fontFamily: 'Avenir', fontSize: 16, textAlign: 'center'}
thumbnailImageStyleImage.proptypes.stylethumbnail image style{width: 125, height: 125, borderWidth: 2, borderRadius: 2}
containerStyleView.proptypes.styleanimated view style{position: 'absolute', bottom: 0}
itemContainerStyleView.proptypes.styleitem view style{flexDirection: 'column', paddingLeft: 8, paddingRight: 8, paddingTop: 8, alignItems: 'center}

Keywords

thumbnail

FAQs

Package last updated on 23 Apr 2017

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.