Skip to content

Icon Misaligned on Button When Using FontAwesome Icon #4664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
KiddoV opened this issue Mar 25, 2025 · 1 comment
Closed

Icon Misaligned on Button When Using FontAwesome Icon #4664

KiddoV opened this issue Mar 25, 2025 · 1 comment

Comments

@KiddoV
Copy link

KiddoV commented Mar 25, 2025

Current behaviour

Icon misaligned when I use button with FontAwesome icons.

Expected behaviour

Icon should aligned perfectly in center like normal one.

How to reproduce?

import { Appbar, Avatar, Text } from "react-native-paper";
import FontAwesome6 from '@expo/vector-icons/FontAwesome6';

[...]
<Appbar.Action icon={(props)=><FontAwesome6 name="plus" iconStyle="solid" {...props} />} onPress={() => {}} />

Preview

[...]
headerRight: (props) => (
    <Appbar.Action icon={(props)=><FontAwesome6 name="plus" iconStyle="solid" {...props} />} onPress={() => {}} />
)

Image

My works around is to add a View with alignItems: center

headerRight: (props) => (
    <Appbar.Action icon={(props)=><View style={{alignItems: "center"}}><FontAwesome6 name="plus" iconStyle="solid" {...props} /></View>} onPress={() => {}} />
)

Image

Your Environment

software version
ios N/A
android N/A
react-native 0.76.7
react-native-paper 5.13.1
node Node.js v20.10.0
npm or yarn 10.4.0
expo sdk 0.22.19
@lukewalczak
Copy link
Member

Hey @KiddoV, it looks like the plus icon from FontAwesome package can be a bit misaligned – I've compared FontAwesome6, FontAwesome, Ionicons and Feather and only first two are not centered:

FontAwesome6 FontAwesome Ionicons Feather
Image Image Image Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants