Type Alias UFFloaterOptions

UFFloaterOptions: {
    autoHide: UFFloaterAutoHide;
    autoShow: UFFloaterAutoShow;
    canHide: (event: Event | null) => boolean | null;
    content: string | HTMLElement;
    customHide: UFFloaterTransitionCallback | null;
    customShow: UFFloaterTransitionCallback | null;
    element: string | HTMLElement | null | HTMLElement[];
    elementX: number;
    elementY: number;
    floaterX: number;
    floaterY: number;
    height: number | null;
    inBounds: boolean;
    onHidden: () => void | null;
    onInitialized: (floater: UFFloater) => void | null;
    onShown: () => void | null;
    positionX: UFFloaterElementPosition;
    positionY: UFFloaterElementPosition;
    screenX: number | string;
    screenY: number | string;
    transition: UFFloaterTransition;
    width: number | null;
}

The options for UFFloater

Type declaration

  • autoHide: UFFloaterAutoHide

    When to hide the floater. The default value is UFFloaterAutoHide.Outside.

  • autoShow: UFFloaterAutoShow

    When to show or hide the floater when the user clicks or taps the element. The default value is UFFloaterAutoShow.Toggle

  • canHide: (event: Event | null) => boolean | null

    Function to check if floater can be hidden. The event is set if the callback is triggered in response to a user action.

  • content: string | HTMLElement

    Content for floater. The default value is an empty string (no content).

  • customHide: UFFloaterTransitionCallback | null

    Custom hide transition.

  • customShow: UFFloaterTransitionCallback | null

    Custom show transition.

  • element: string | HTMLElement | null | HTMLElement[]

    Element to position floater to. The default value is null. When not null the floater instance will check if the element is clicked/tapped up on and will show or hide the floater.

  • elementX: number

    Used when element is set. Check the comment of positionX to see how this value is used. The default value is 0.

  • elementY: number

    Used when element is set. Check the comment of positionY to see how this value is used. The default value is 0.

  • floaterX: number

    Used when element is set and positionX is UFFloaterElementPosition.Relative. The default value is 0.

  • floaterY: number

    Used when element is set and positionY is UFFloaterElementPosition.Relative. The default value is 0.

  • height: number | null

    Height in pixels or null to let the height be defined by content. The default value is null.

  • inBounds: boolean

    When true keep floater fully visible, even if the element is scrolled (partially) outside the visible area.

  • onHidden: () => void | null

    Callback that is called when floater is hidden.

  • onInitialized: (floater: UFFloater) => void | null

    Callback that is called when the floater has initialized and all properties are set.

  • onShown: () => void | null

    Callback that is called when floater is shown.

  • positionX: UFFloaterElementPosition

    Determines how to use the floaterX and elementX values. The default value is UFFloaterElementPosition.Adjacent.

  • positionY: UFFloaterElementPosition

    Determines how to use the floaterY and elementY values. The default value is UFFloaterElementPosition.Overlap.

  • screenX: number | string

    This field is used if no element is set. It is the horizontal position of the floater within the screen. If the value is a number, it is processed as relative position both within the floater as within the screen; with 0.0 being at the start and 1.0 at the end. If the value is a string, the value is just assigned to the left style. The default value is 0.5; placing the center of the floater at the center of the screen.

  • screenY: number | string

    This field is used if no element is set. It is the vertical position of the floater within the screen. If the value is a number, it is processed as relative position both within the floater as within the screen; with 0.0 being at the start and 1.0 at the end. If the value is a string, the value is just assigned to the top style. The default value is 0.5; placing the center of the floater at the center of the screen.

  • transition: UFFloaterTransition

    Transition to use. The default value is UFFloaterTransition.None.

  • width: number | null

    Width in pixels or null to let the width be defined by content. The default value is null.