Nutrient Web SDK
    Preparing search index...

    Interface DocumentEditorFooterItem

    Describes the properties of a Document Editor Footer Item.

    Check out our guides for more examples.

    interface DocumentEditorFooterItem {
        className?: string;
        id?: string;
        node?: Node;
        onPress?: (
            event: Event,
            documentEditorUIHandler?: DocumentEditorUIHandler,
            id?: string,
        ) => void;
        type: BuiltInDocumentEditorFooterItem | "custom";
    }
    Index

    Properties

    className?: string

    Useful to set a custom CSS class name on the item.

    For default document editor footer items the className is appended to the default item ones.

    id?: string

    Unique identifier for the item.

    This is useful to identify items whose type is custom.

    // In your JavaScript
    const documentEditorFooterItems = NutrientViewer.defaultDocumentEditorFooterItems
    documentEditorFooterItems.push({ type: 'custom', id: 'my-button', ... })
    NutrientViewer.load({
    ...otherOptions,
    documentEditorFooterItems
    });

    Note: It is ***not*** possible to override this option for built-in document editor footer items.
    node?: Node

    custom tool items have to define a DOM node which NutrientViewer will render.

    In this case the tool item is rendered inside of a container div. The className which you pass is set to this container div and not to the node that you passed.

    The onPress event is registered and fires any time the item is clicked.

    onPress?: (
        event: Event,
        documentEditorUIHandler?: DocumentEditorUIHandler,
        id?: string,
    ) => void

    Callback to invoke when the item is clicked or tapped (on touch devices). It gets the event as first argument, a document editor UI handler object as the second, and the id of the tool item as the third.

    Built in items do not receive a documentEditorUIHandler

    Type Declaration

      • (
            event: Event,
            documentEditorUIHandler?: DocumentEditorUIHandler,
            id?: string,
        ): void
      • Parameters

        • event: Event

          The event that is fired on press. onPress is also fired when pressing enter while the item has focus.

        • OptionaldocumentEditorUIHandler: DocumentEditorUIHandler

          An instance object to set and retrieve different state properties of the document editor UI. Built in items do not receive a documentEditorUIHandler

        • Optionalid: string

          The tool item id.

        Returns void

    type: BuiltInDocumentEditorFooterItem | "custom"

    The type of a document editor footer item.

    It can either be custom for user defined items or one from the NutrientViewer.defaultDocumentEditorFooterItems. Note: It is not possible to override this option for built-in toolbar items.

    // In your JavaScript
    const documentEditorFooterItems = NutrientViewer.defaultDocumentEditorFooterItems
    documentEditorFooterItems.push({ type: 'custom', ... })
    NutrientViewer.load({
    ...otherOptions,
    documentEditorFooterItems
    });