react-native-bpk-component-carousel-indicator

Backpack React Native carousel indicators component.

Usage no npm install needed!

<script type="module">
  import reactNativeBpkComponentCarouselIndicator from 'https://cdn.skypack.dev/react-native-bpk-component-carousel-indicator';
</script>

README

react-native-bpk-component-carousel-indicator

Backpack React Native carousel indicators component.

Installation

npm install react-native-bpk-component-carousel-indicator --save-dev

Usage

import React, { Component } from 'react';
import { View, StyleSheet } from 'react-native';
import { spacingBase } from 'bpk-tokens/tokens/base.react.native';
import BpkCarouselIndicator from 'react-native-bpk-component-carousel-indicator';

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    padding: spacingBase,
  },
});

export default class App extends Component {
  render() {
    return (
      <View style={styles.container}>
        <BpkCarouselIndicator pageCount="10" selectedIndex="0" />
        <BpkCarouselIndicator pageCount="3" selectedIndex="2" />
        <BpkCarouselIndicator pageCount="5" selectedIndex="1" />
      </View>
    );
  }
}

Props

Property PropType Required Default Value
pageCount number true -
selectedIndex number true -