Skip to content

Latest commit

 

History

History

bpk-component-carousel-indicator

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

bpk-component-carousel-indicator

Backpack React Native carousel indicators component.

Default

Day Night
bpk-component-carousel-indicator default iPhone 8 simulator bpk-component-carousel-indicator default iPhone 8 simulator - dark mode
bpk-component-carousel-indicator default Google Pixel emulator bpk-component-carousel-indicator default Google Pixel emulator - dark mode

With overlay

Day Night
bpk-component-carousel-indicator with-overlay iPhone 8 simulator bpk-component-carousel-indicator with-overlay iPhone 8 simulator - dark mode
bpk-component-carousel-indicator with-overlay Google Pixel emulator bpk-component-carousel-indicator with-overlay Google Pixel emulator - dark mode

Installation

Check the main Readme for a complete installation guide.

Usage

import React, { Component } from 'react';
import { View, StyleSheet } from 'react-native';
import { spacingBase } from '@skyscanner/bpk-foundations-react-native/tokens/base.react.native';
import BpkCarouselIndicator from 'backpack-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 -