ComPDFKit Web SDK
    Preparing search index...

    Class Flyout

    A pop-up menu of items, opened by a button whose toggleElement is the flyout's dataElement. Add it with UI.Flyouts.addFlyouts.

    const { Flyout, ToggleElementButton } = instance.UI.Components;
    const exportFlyout = new Flyout({
    dataElement: 'exportFlyout',
    items: [
    { label: 'Download PDF', onClick: () => instance.UI.downloadPdf() },
    'divider',
    { label: 'Print', onClick: () => instance.UI.print() },
    ],
    });
    instance.UI.Flyouts.addFlyouts([exportFlyout]);
    const header = instance.UI.getModularHeader('default-top-header');
    header.setItems([
    ...header.getItems(),
    new ToggleElementButton({ dataElement: 'exportFlyoutToggle', toggleElement: 'exportFlyout', img: 'Download' }),
    ]);

    Hierarchy (View Summary)

    Index
    • Replaces the items of the flyout and updates it on screen.

      Parameters

      • items: unknown[]

        Flyout items: objects with label, onClick, icon or children, component instances, 'divider', or dataElements of existing items.

      Returns void

    dataElement: string

    Unique name of the flyout.

    items: FlyoutItem[]

    Items of the flyout; assigning a new array is the same as calling setItems.

    properties: FlyoutData

    The flyout's data as added to the viewer by UI.Flyouts.addFlyouts.

    toggleElement?: string

    dataElement of the element that opens the flyout.

    type: string

    Item type: 'flyout'.