Skip to content
Last updated

The Font Awesome Icons component provides access to the complete Font Awesome icon library within your React components. It uses CDN-based loading for optimal performance and supports all Font Awesome icon styles.

Import

import { CDNIcon } from '@redocly/theme/icons/CDNIcon/CDNIcon';

Properties

PropertyTypeDescription
namestringREQUIRED. The FontAwesome icon name. Supports all Font Awesome icons from the built-in packs: Classic Regular, Classic Solid, Duotone Solid, and Classic Brands.
typestringThe style of the icon. Possible values: regular, solid, duotone, brands. Default: regular
packstringThe icon pack to use. Possible values: font-awesome, code. Default: font-awesome
modestringThe rendering mode. Possible values: mask, background. Default: mask
sizestringThe size of the icon. Accepts any CSS value for size, like px or em. Default: 1em
colorstringThe color of the icon. Accepts any CSS color value. Default: currentColor
classNamestringOptional CSS class name for additional styling.
Standard SVG propertiesReact.SVGPropsAll standard SVG properties are supported.

Basic usage

Display a simple Font Awesome icon:

import React from 'react';
import { CDNIcon } from '@redocly/theme/icons/CDNIcon/CDNIcon';

export function MyComponent() {
  return (
    <div>
      <CDNIcon name="book" />
    </div>
  );
}

Resources