Skip to content

Icon Misaligned on Button When Using FontAwesome Icon #4664

@KiddoV

Description

@KiddoV

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions