testshallpass / react-native-thumbnail-selector

A thumbnail selector to select items in a horizontal list.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-thumbnail-selector

Platform npm npm License CI

Table of contents

Installation

yarn yarn add react-native-thumbnail-selector
npm npm install react-native-thumbnail-selector --save

Support

react version react-native version package version reason
v16.8.0 v0.61.0 >=3.0.0 React hooks and usage of useWindowDimensions

Demo

screenshot

Usage

import ThumbnailSelector from 'react-native-thumbnail-selector';

const thumbnails = [
  {
    caption: 'react-native',
    imageSrc: {uri: 'https://reactnative.dev/img/tiny_logo.png'},
  },
  {
    caption: 'Dolore do magna ullamco nisi quis.',
    imageSrc: {uri: 'https://reactnative.dev/img/tiny_logo.png'},
  },
];

function Example() {
  // use toggle to show and hide ThumbnailSelector
  let toggle = () => new Promise<unknown>(res => res);

  return (
    <ThumbnailSelector
      thumbnails={thumbnails}
      toggle={func => (toggle = func)}
    />
  );
}

export default Example;

About

A thumbnail selector to select items in a horizontal list.

License:MIT License


Languages

Language:TypeScript 67.2%Language:Kotlin 9.5%Language:Objective-C 8.4%Language:Ruby 7.4%Language:JavaScript 4.4%Language:Objective-C++ 3.0%