Backpack React Native icon component.
Day | Night |
---|---|
Check the main Readme for a complete installation guide.
import { View } from 'react-native';
import React, { Component } from 'react';
import BpkIcon, { icons } from 'backpack-react-native/bpk-component-icon';
import { spacingBase, colorSkyBlue } 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}>
<BpkIcon
icon={icons.beer}
style={{ color: colorSkyBlue }}
small
/>
<BpkIcon
icon={icons.beer}
style={{ color: colorSkyBlue }}
/>
</View>
);
}
}
import { View } from 'react-native';
import React, { Component } from 'react';
import BpkIcon, { icons, withRtlSupport } from 'backpack-react-native/bpk-component-icon';
import { spacingBase, colorSkyBlue } from '@skyscanner/bpk-foundations-react-native/tokens/base.react.native';
const BpkIconwithRtlSupport = withRtlSupport(BpkIcon);
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
padding: spacingBase,
}
});
export default class App extends Component {
render() {
return (
<View style={styles.container}>
<BpkIconwithRtlSupport
icon={icons.beer}
style={{ color: colorSkyBlue }}
/>
</View>
);
}
}
Property | PropType | Required | Default Value |
---|---|---|---|
icon | string | true | - |
small | bool | false | false |