FontAwesome React API Reference
    Preparing search index...

    Interface FontAwesomeIconProps

    interface FontAwesomeIconProps {
        icon: IconProp;
        beat?: boolean;
        beatFade?: boolean;
        border?: boolean;
        bounce?: boolean;
        className?: string;
        color?: string;
        fade?: boolean;
        fixedWidth?: boolean;
        flip?: boolean | FlipProp;
        gradientFill?:
            | { type: "linear" } & LinearGradient
            | { type: "radial" } & RadialGradient;
        inverse?: boolean;
        listItem?: boolean;
        mask?: IconProp;
        maskId?: string;
        pull?: PullProp;
        pulse?: boolean;
        rotateBy?: boolean;
        rotation?: RotateProp;
        shake?: boolean;
        size?: SizeProp;
        spin?: boolean;
        spinPulse?: boolean;
        spinReverse?: boolean;
        style?: CSSProperties & CSSVariables;
        swapOpacity?: boolean;
        symbol?: FaSymbol;
        tabIndex?: number;
        title?: string;
        titleId?: string;
        transform?: string | Transform;
        widthAuto?: boolean;
    }

    Hierarchy (View Summary)

    Index

    Properties

    icon: IconProp

    The icon to render.

    beat?: boolean

    Makes the icon scale in and out continuously.

    beatFade?: boolean

    Applies both scaling and fading animations from beat and fade.

    border?: boolean

    Applies a border to the icon

    bounce?: boolean

    Makes the icon bounce up and down.

    className?: string

    Any additional CSS classes to apply to the icon

    color?: string

    The color of the icon. Can be any valid CSS color value

    fade?: boolean

    Makes the icon fade in and out continuously.

    fixedWidth?: boolean

    7.0.0

    Starting in FontAwesome 7.0.0, all icons are fixed width by default. This property will be removed in a future version.

    If you want to remove the fixed width to replicate the behavior of previous versions, you can set the new widthAuto property to true.

    flip?: boolean | FlipProp

    Flip the icon horizontally, vertically or both.

    gradientFill?:
        | { type: "linear" } & LinearGradient
        | { type: "radial" } & RadialGradient

    Creates a <linearGradient /> or <radialGradient /> element inside the icon svg, and applies it as a fill to the icon.

    If you also provide a fill prop, the fill prop will take precedence over the gradient. Omit the fill prop to allow the gradient to be applied correctly.

    Linear Gradient Example:

    <FontAwesomeIcon
    icon="coffee"
    gradientFill={{
    id: 'myGradient',
    type: 'linear',
    x1: '0%',
    y1: '0%',
    x2: '100%',
    y2: '0%',
    stops: [
    { offset: '0%', color: '#FF5F6D' },
    { offset: '100%', color: '#FFC371' },
    ],
    }}
    />

    Radial Gradient Example:

    <FontAwesomeIcon
    icon="coffee"
    gradientFill={{
    id: 'myGradient',
    type: 'radial',
    r: '150%',
    cx: '30%',
    cy: '107%',
    stops: [
    { offset: '0', color: '#FDF497' },
    { offset: '0.05', color: '#FDF497' },
    { offset: '0.45', color: '#FD5949' },
    { offset: '0.6', color: '#D6249F' },
    { offset: '0.9', color: '#285AEB' },
    ],
    }}
    />

    NOTE: Only supports one gradient type, providing both linear and radial gradient props will have undesired side-effects.

    inverse?: boolean

    Invert the icon color.

    listItem?: boolean

    Simply wrap the icon instead, no need to pass this property.

    <ul className='fa-ul'>
    <li>
    <span className='fa-li'>
    <FontAwesomeIcon icon={['fas', 'check']} />
    </span>
    List item with icon
    </li>
    </ul>
    mask?: IconProp

    Grab the Mask utility when you want to layer two icons but have the inner icon cut out from the icon below so the parent element’s background shows through.

    maskId?: string

    Accessibility ID for the mask element

    pull?: PullProp

    Wrap text around the icon by pulling it left or right.

    pulse?: boolean

    Will be removed in a future version. Please use spinPulse instead.

    Makes the icon spin 360deg clockwise in 8 incremental steps.

    rotateBy?: boolean

    Custom rotation is used to rotate the icon by a specific number of degrees, rather than the standard 90, 180, or 270 degrees available in the rotation property.

    To use this feature, set rotateBy to true and provide a CSS variable --fa-rotate-angle with the desired rotation angle in degrees.

    <FontAwesomeIcon
    icon="fa-solid fa-coffee"
    rotateBy
    style={{ '--fa-rotate-angle': '329deg' }}
    />

    7.0.0

    rotation?: RotateProp

    The rotation property is used to rotate the icon by 90, 180, or 270 degrees.

    shake?: boolean

    Makes the icon shake.

    size?: SizeProp

    The size of the icon from a predefined set of sizes.

    spin?: boolean

    Makes the icon spin 360deg clockwise continuously.

    spinPulse?: boolean

    Makes the icon spin 360deg clockwise in 8 incremental steps.

    spinReverse?: boolean

    When used in conjunction with spin or spinPulse, makes the icon spin in reverse.

    Any custom styles or CSS variable overrides for the icon element.

    swapOpacity?: boolean

    When using Duotone icons, this property will swap the opacity of the two colors. The first color will be rendered with the opacity of the second color, and vice versa

    symbol?: FaSymbol

    The icon should render as an SVG symbol rather than a regular element.

    tabIndex?: number
    title?: string

    7.0.0

    Starting in FontAwesome 7.0.0, icons are decorative by default. Instead of using a title prop, use the aria-label attribute instead.

    titleId?: string

    7.0.0

    Starting in FontAwesome 7.0.0, icons are decorative by default. Instead of using a titleId prop, use an aria-label attribute instead.

    transform?: string | Transform

    Apply a custom transform to the icon either using the built-in Transform config, or a CSS transform string.

    widthAuto?: boolean

    When set to true, the icon will automatically adjust its width to only the interior symbol and not the entire Icon Canvas.