I have button like the sample below with an icon (addFriendIcon).
https://developer.microsoft.com/en-us/fluentui#/controls/web/button
How do I add a style to this icon? For example change the color?
import * as React from 'react'; import { ActionButton, IIconProps } from 'office-ui-fabric-react';
const addFriendIcon: IIconProps = { iconName: 'AddFriend' };
export const ButtonActionExample: React.FunctionComponent = props => {
return ( Create account ); };
If you want to do it the Fluent UI way, just add the according styles to the IIconProps:
const addFriendIcon: IIconProps = {
iconName: 'AddFriend',
styles: {
root: { color: 'red' }
}
};
Here is the adjusted codepen: https://codepen.io/alex3683/pen/RwarOrb