Skip to main content

IconPlatform

Content

Shows provided SF Symbol for iOS or Material Icon for Android or if both aren't provided then returns null.

Params

Extends IconProps of react-native-vector-icons/Icon and SFSymbolProps of react-native-sfsymbols and omits name of both of them.

NameTypeRequiredDefault valueDescription
iosNameSFSymbolsFalseUndefinedSF Symbol fron enum
androidNamestringFalseUndefinedName of Material Icon
colorColorValueFalseUndefinedColor of icon
styleTextStyle or ViewStyleFalseUndefinedStyle of icon

Usage example

        <IconPlatform
iosName={SFSymbols["star.fill"]}
androidName={"star-rate"}
size={moderateScale(32)}
resizeMode={"contain"}
color={platformNativeColor(PlatformColorsIOS.systemBlue, PlatformColorsAndroid.primary)}
style={styles.clauseIcon}
/>