@expo/vector-icons#FontAwesome5 TypeScript Examples
The following examples show how to use
@expo/vector-icons#FontAwesome5.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BottomTabNavigator.tsx From SpotifyClone with MIT License | 6 votes |
export default function BottomTabNavigator() {
const colorScheme = useColorScheme();
return (
<BottomTab.Navigator
initialRouteName="TabOne"
tabBarOptions={{ activeTintColor: Colors[colorScheme].tint }}>
<BottomTab.Screen
name="Home"
component={TabOneNavigator}
options={{
tabBarIcon: ({ color }) => <Entypo name="home" size={30} style={{ marginBottom: -3 }} color={color} />,
}}
/>
<BottomTab.Screen
name="Search"
component={TabTwoNavigator}
options={{
tabBarIcon: ({ color }) => <EvilIcons name="search" size={30} style={{ marginBottom: -3 }} color={color} />,
}}
/>
<BottomTab.Screen
name="Your Library"
component={TabTwoNavigator}
options={{
tabBarIcon: ({ color }) => <MaterialCommunityIcons name="library-music-outline" size={30} style={{ marginBottom: -3 }} color={color} />,
}}
/>
<BottomTab.Screen
name="Premium"
component={TabTwoNavigator}
options={{
tabBarIcon: ({ color }) => <FontAwesome5 name="spotify" size={30} style={{ marginBottom: -3 }} color={color} />,
}}
/>
</BottomTab.Navigator>
);
}
Example #2
Source File: index.tsx From tiktok-clone with MIT License | 6 votes |
HomeButton: React.FC<Props> = ({ home }) => {
return (
<Container home={home}>
<Button>
<FontAwesome5 name="plus" size={18} color={home ? '#000' : '#fff'} />
</Button>
</Container>
);
}
Example #3
Source File: SectionListExample.tsx From react-native-scroll-bottom-sheet with MIT License | 4 votes |
SectionListExample: React.FC<Props> = () => {
const snapPointsFromTop = [96, '45%', windowHeight - 264];
const animatedPosition = React.useRef(new Value(0.5));
const handleLeftRotate = concat(
interpolate(animatedPosition.current, {
inputRange: [0, 0.4, 1],
outputRange: [25, 0, 0],
extrapolate: Extrapolate.CLAMP,
}),
'deg'
);
const handleRightRotate = concat(
interpolate(animatedPosition.current, {
inputRange: [0, 0.4, 1],
outputRange: [-25, 0, 0],
extrapolate: Extrapolate.CLAMP,
}),
'deg'
);
const cardScale = interpolate(animatedPosition.current, {
inputRange: [0, 0.6, 1],
outputRange: [1, 1, 0.9],
extrapolate: Extrapolate.CLAMP,
});
const renderSectionHeader = React.useCallback(
({ section }) => (
<View style={styles.section}>
<Text>{section.title}</Text>
</View>
),
[]
);
const renderItem = React.useCallback(
({ item }) => <Transaction {...item} />,
[]
);
return (
<View style={styles.container}>
<View style={styles.balanceContainer}>
<Text style={styles.poundSign}>£</Text>
<Text style={styles.balance}>4,345</Text>
</View>
<ProgressBar
style={styles.progressBar}
progress={0.8}
color={Colors.green600}
/>
<Animated.Image
source={require('../assets/card-front.png')}
style={[styles.card, { transform: [{ scale: cardScale }] }]}
/>
<View style={styles.row}>
<View>
<View style={styles.action}>
<FontAwesome5 name="credit-card" size={24} color="black" />
</View>
<Text style={{ textAlign: 'center' }}>Account</Text>
</View>
<View>
<View style={styles.action}>
<FontAwesome5 name="eye" size={24} color="black" />
</View>
<Text style={{ textAlign: 'center' }}>Pin</Text>
</View>
<View>
<View style={styles.action}>
<Ionicons name="md-snow" size={24} color="black" />
</View>
<Text style={{ textAlign: 'center' }}>Freeze</Text>
</View>
<View>
<View style={styles.action}>
<FontAwesome5 name="plus" size={24} color="black" />
</View>
<Text style={{ textAlign: 'center' }}>Top up</Text>
</View>
</View>
<ScrollBottomSheet<ListItemData>
enableOverScroll
removeClippedSubviews={Platform.OS === 'android' && sections.length > 0}
componentType="SectionList"
topInset={statusBarHeight + navBarHeight}
animatedPosition={animatedPosition.current}
snapPoints={snapPointsFromTop}
initialSnapIndex={1}
animationConfig={{
easing: Easing.inOut(Easing.linear),
}}
renderHandle={() => (
<Handle style={{ paddingVertical: 20, backgroundColor: '#F3F4F9' }}>
<Animated.View
style={[
styles.handle,
{
left: windowWidth / 2 - 20,
transform: [{ rotate: handleLeftRotate }],
},
]}
/>
<Animated.View
style={[
styles.handle,
{
right: windowWidth / 2 - 20,
transform: [{ rotate: handleRightRotate }],
},
]}
/>
</Handle>
)}
contentContainerStyle={styles.contentContainerStyle}
stickySectionHeadersEnabled
sections={sections}
keyExtractor={i => i.id}
renderSectionHeader={renderSectionHeader}
renderItem={renderItem}
/>
</View>
);
}