@fortawesome/react-fontawesome

  • Version 3.0.0
  • Published
  • 63 kB
  • 1 dependency
  • MIT license

Install

npm i @fortawesome/react-fontawesome
yarn add @fortawesome/react-fontawesome
pnpm add @fortawesome/react-fontawesome

Overview

Official React component for Font Awesome

Index

Variables

variable FontAwesomeIcon

const FontAwesomeIcon: React.ForwardRefExoticComponent<any>;
  • FontAwesomeIcon component.

Interfaces

interface AnimationProps

interface AnimationProps {}

    property beat

    beat?: boolean | undefined;

    property beatFade

    beatFade?: boolean | undefined;

    property bounce

    bounce?: boolean | undefined;

    property fade

    fade?: boolean | undefined;

    property pulse

    pulse?: boolean | undefined;

    property shake

    shake?: boolean | undefined;

    property spin

    spin?: boolean | undefined;

    property spinPulse

    spinPulse?: boolean | undefined;

    property spinReverse

    spinReverse?: boolean | undefined;

    interface FontAwesomeIconProps

    interface FontAwesomeIconProps
    extends AnimationProps,
    TransformProps,
    Omit<SVGAttributes<SVGSVGElement>, 'children' | 'mask' | 'transform'>,
    RefAttributes<SVGSVGElement> {}

      property border

      border?: boolean | undefined;

      property className

      className?: string | undefined;
      • Any additional CSS classes to apply to the icon

      property color

      color?: string | undefined;
      • The color of the icon. Can be any valid CSS color value

      property fixedWidth

      fixedWidth?: boolean | undefined;
      • See Also

        Deprecated

        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.

      property icon

      icon: IconProp;

      property inverse

      inverse?: boolean | undefined;

      property mask

      mask?: IconProp | undefined;

      property maskId

      maskId?: string | undefined;
      • Accessibility ID for the mask element

      property size

      size?: SizeProp | undefined;
      • The size of the icon from a predefined set of sizes.

      property style

      style?: (CSSProperties & CSSVariables) | undefined;
      • Any custom styles or CSS variable overrides for the icon element.

      property swapOpacity

      swapOpacity?: boolean | undefined;

      property tabIndex

      tabIndex?: number | undefined;

        property title

        title?: string | undefined;
        • An accessibility title for the icon to be read by screen-readers or assistive technologies.

        property titleId

        titleId?: string | undefined;
        • A unique ID for the accessibility title element.

        property widthAuto

        widthAuto?: boolean | undefined;

        interface TransformProps

        interface TransformProps {}

          property flip

          flip?: FlipProp | boolean | undefined;
          • Flip the icon horizontally, vertically or both.

          property listItem

          listItem?: boolean | undefined;
          • Example 1

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

            See Also

            Deprecated

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

          property pull

          pull?: PullProp | undefined;
          • Wrap text around the icon by pulling it left or right.

          property rotateBy

          rotateBy?: boolean | undefined;
          • 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.

            Example 1

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

            See Also

          property rotation

          rotation?: RotateProp | undefined;

          property symbol

          symbol?: FaSymbol | undefined;

          property transform

          transform?: string | Transform | undefined;

          Package Files (1)

          Dependencies (1)

          Dev Dependencies (46)

          Peer Dependencies (2)

          Badge

          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@fortawesome/react-fontawesome.

          • Markdown
            [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@fortawesome/react-fontawesome)
          • HTML
            <a href="https://www.jsdocs.io/package/@fortawesome/react-fontawesome"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>