Skip to content

Latest commit

 

History

History

bpk-component-switch

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

bpk-component-switch

Backpack React Native switch component.

Default

Day Night
bpk-component-switch default iPhone 8 simulator bpk-component-switch default iPhone 8 simulator - dark mode
bpk-component-switch default Google Pixel emulator bpk-component-switch default 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 BpkSwitch from 'backpack-react-native/bpk-component-switch';
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}>
        <BpkSwitch />
        <BpkSwitch value />
      </View >
    );
  }
}

Props

Property PropType Required Default Value
value bool false false
theme See Theme Props below false null

Theme Props

  • switchPrimaryColor