FxReferencePopover

Type: React component

How to get FxReferencePopover?

JavaScript

import FxReferencePopover from 'fontoxml-fx/src/FxReferencePopover.jsx'

A component used for making a popover for references.

  • When the reference is resolving, the popover will show a loading state.

  • When an error occured while resolving the reference, the popover will show an error state.

  • When the reference is resolved a popoverBody can be determined based on this resolved reference.

  • The popover has a button to remove the reference and optional a button to edit the reference.

If the popover is for cross links consider using CrossReferencePopover instead. If the popover is for hyper links WebReferencePopover can be used.

Props

  1. data

    (Required)

    Type: Object

    The popoverData as provided by the family configuration, this only needs to be passed through.

    Properties

  2. togglePopover

    (Required)

    Type: Function

    A property that comes from the popover method self (see Create a popover), this only needs to be passed through.

  3. openPreview

    (Optional)

    Type: Function

    When used, this will open the preview for the reference.

    Is called when the openPreview callback in renderReference is called.

    Arguments

  4. renderReference

    (Required)

    Type: Function

    Render the popoverBody based on the resolved reference.

    Arguments

    Returns

  5. resolveReference

    (Optional)

    Type: Function

    This callback will be triggered when the popover is openend or after the permanent id is resolved (if the reference has permanent ids data.targetIsPermanentId).

    Arguments

    Returns

    Default value