Icon

Type: React component

How to get Icon?

JavaScript

import { Icon } from 'fds/components';

Renders an icon from Font Awesome.

Props

  1. colorName

    (Optional)

    Type: String

    The name of the color to use in the component. FDS has implemented a color palette for all of the components implemented in the library.

    When building a custom component, try to use the existing colors as much as possible. Try to find an FDS component which is similar to the component you're building. When using colors this way, you can guarantee your component will use the correct color when the style of the library updates.

    The possible values can be found in the example.

    Related links

    Default value

  2. icon

    (Optional)

    Type: String

    The name of the icon displayed in the component.

    This should be one of the Font Awesome icons. Do not include the fa- prefix, just use the icon names as-is from the documentation.

  3. isInline

    (Optional)

    Type: Boolean

    Whether or not to render this icon inline with other text. (Set to true when rendering this icon inside a <Text> or <Label>).

  4. flipHorizontal

    (Optional)

    Type: Boolean

    Visually mirrors the icon horizontally.

    Default value

  5. flipVertical

    (Optional)

    Type: Boolean

    Visually mirrors the icon vertically.

    Default value

  6. tooltipContent

    (Optional)

    Type: String | ReactElement

    The content of the tooltip that is displayed when hovering over the whole component.

    • string: the textual content of the tooltip

    • ReactElement: a React Element (instance of a React Component, usually created with JSX)

    Default value

  7. size

    (Optional)

    Type: String

    The size of Icon to render. The possible values are:

    • 's'

    • 'm'

    • 'l'

    Default value