Spinner

Spinners are used to indicate that a part of the product is loading or performing a task when the amount of time needed is unknown.

bpk-component-spinner

Backpack React Native spinner component.

Default

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

Small

Day Night
bpk-component-spinner small iPhone 8 simulator bpk-component-spinner small iPhone 8 simulator - dark mode
bpk-component-spinner small Google Pixel emulator bpk-component-spinner small Google Pixel emulator - dark mode

Installation

Check the main Readme for a complete installation guide.

Usage


                                                
                                                import React, { Component } from 'react';
                                                import { View, StyleSheet, Text } from 'react-native';
                                                import BpkSpinner from 'backpack-react-native/bpk-component-spinner';
                                                import { spacingBase } from '@skyscanner/bpk-foundations-react-native/tokens/base.react.native';
                                                
                                                const styles = StyleSheet.create({
                                                  container: {
                                                    flex: 1,
                                                    justifyContent: 'center',
                                                    padding: spacingBase,
                                                  }
                                                });
                                                
                                                export default class App extends Component {
                                                  render() {
                                                    return (
                                                      <View style={styles.container}>
                                                        <BpkSpinner />
                                                        <BpkSpinner small />
                                                        <BpkSpinner type="light" />
                                                        <BpkSpinner type="dark" />
                                                      </View >
                                                    );
                                                  }
                                                }

Props

Property PropType Required Default Value
small bool false false
theme See Theme Props below false null
type oneOf('primary', 'light', 'dark') false primary

Theme Props

Primary

  • spinnerPrimaryColor