在React-Icons中添加原始颜色图标

问题描述 投票:0回答:1

这是我的代码片段:

<div className="mt-6 flex gap-2">
    <AuthSocialButton
        icon={BsGithub}
        onClick={() => socialAction('github')}
    />
    <AuthSocialButton
        icon={BsGoogle}
        onClick={() => socialAction('google')}
    />
</div>

React-icons 本身只有空白灰色。有没有办法将徽标颜色添加到反应图标中?我不是说添加背景颜色,我的意思是例如Google图标必须有Google等的图标颜色

感谢您的宝贵时间。

reactjs react-native next.js13 react-icons
1个回答
0
投票

您是否尝试添加内联样式或 CSS 类? 类似的东西?

<AuthSocialButton
icon={<BsGithub style={{ color: '#333' }} />}  // GitHub's color
onClick={() => socialAction('github')}/>
© www.soinside.com 2019 - 2024. All rights reserved.