@nextcloud/files
    Preparing search index...

    Interface ISidebarTab

    Implementation of a custom sidebar tab within the files app.

    interface ISidebarTab {
        displayName: string;
        enabled?: (context: ISidebarContext) => boolean;
        iconSvgInline: string;
        id: string;
        onInit?: () => Promise<void>;
        order: number;
        tagName: string;
    }
    Index

    Properties

    displayName: string

    The localized name of the sidebar tab.

    enabled?: (context: ISidebarContext) => boolean

    Callback to check if the sidebar tab should be shown for the selected node.

    If not provided, the tab will always be shown.

    Type Declaration

    iconSvgInline: string

    The icon, as SVG, of the sidebar tab.

    id: string

    Unique id of the sidebar tab. This has to conform to the HTML id attribute specification.

    onInit?: () => Promise<void>

    Called when the sidebar tab is active and rendered the first time in the sidebar. This should be used to register the web componen (CustomElementRegistry.define()).

    The sidebar itself will anyways wait for the component to be defined in the registry (customElements.whenDefined()). But also will wait for the promise returned by this method to resolve before rendering the tab.

    order: number

    The order of this tab. Use a low number to make this tab ordered in front.

    tagName: string

    The tag name of the web component.

    The web component must be defined using this name with CustomElementRegistry.define(), either on initialization or within the onInit callback (preferred). When rendering the sidebar tab, the files app will wait for the component to be defined in the registry (customElements.whenDefined()).

    To avoid name clashes the name has to start with your appid (e.g. your_app). So in addition with the web component naming rules a good name would be your_app-files-sidebar-tab.