ParsedIcon

Result of parsing an icon prop Contains the detected type and formatted icon ready for rendering

Definition

export interface ParsedIcon {
    /**
     * Detected icon type
     */
    type: IconType;

    /**
     * Icon formatted for the appropriate wrapper
     * - FontAwesome: IconProp array ['fas', 'save']
     * - Phosphor: PHIconProp array ['phb', 'house']
     * - Image: URL string
     * - Text: text/emoji string
     * - React: ReactElement
     */
    formatted: IconProp | PHIconProp | string | ReactElement;

    /**
     * Original icon prop as passed by the user
     */
    original: any;
}

Usage

Last updated