JSPM

@nguyentc21/react-native-simple-carousel

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q16617F
  • License MIT

A simple carousel for React native app

Package Exports

  • @nguyentc21/react-native-simple-carousel
  • @nguyentc21/react-native-simple-carousel/lib/commonjs/index.js
  • @nguyentc21/react-native-simple-carousel/lib/module/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@nguyentc21/react-native-simple-carousel) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-native-simple-carousel

A simple carousel for React native app (iOS & Android)

Installation

yarn add @nguyentc21/react-native-simple-carousel

Usage

import Carousel from '@nguyentc21/react-native-simple-carousel';

const DATA = [
  { uri: 'https://...... ... ... image1.png' },
  { uri: 'https://...... ... ... image2.png' },
];
// ...
export function NiceView(props: Props) {
  const carouselRef = useRef();
  // ...
  return (
    <>
      {/* ... */}
      <Carousel
        ref={carouselRef}
        data={DATA}
        width={300}
        height={150}
        autoPlay
        // playInvert
        loop
        // initialIndex={0}
        // hideIndicator={DATA.length < 2}
        // indicatorSize={10}
        duration={5000}
        // onChangeIndex={(index) => {
        //   // do something
        // }}
      />
      {/* ... */}
      <Button
        onPress={() => {
          carouselRef.current?.toPrev();
        }}
      >
        Prev
      </Button>
      <Button
        onPress={() => {
          carouselRef.current?.toNext();
        }}
      >
        Next
      </Button>
      {/* ... */}
    </>
  );
}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library