@nextcloud/files
    Preparing search index...

    Interface ISidebar

    interface ISidebar {
        activeTab?: string;
        available: boolean;
        isOpen: boolean;
        node?: INode;
        close(): void;
        getActions(context?: ISidebarContext): ISidebarAction[];
        getTabs(context?: ISidebarContext): ISidebarTab[];
        mount(target: HTMLElement): void;
        open(node: INode, tab?: string): void;
        registerAction(action: ISidebarAction): void;
        registerTab(tab: ISidebarTab): void;
        setActiveTab(tabId: string): void;
        setFullScreenMode(isFullScreen: boolean): void;
    }
    Index
    activeTab?: string

    The currently active sidebar tab id

    available: boolean

    If the files sidebar can currently be accessed, meaning it is rendered on the current page either by the files app or by an app rendering the sidebar within its own app. Registering tabs also works if the sidebar is currently not available.

    isOpen: boolean

    The current open state of the sidebar

    node?: INode

    The currently opened node in the sidebar

    • Close the sidebar.

      When the sidebar is fully closed the files:sidebar:closed event is emitted, see also @nextcloud/event-bus.

      Returns void

    • Render the sidebar into an element of the current app.

      The sidebar is rendered into the app content element as soon as the page is loaded, so this is only needed by apps that render the sidebar into a specific element or that set up their own layout after the page was loaded. Calling this again moves an already rendered sidebar into the requested element.

      Requires the app to request the sidebar for the current page, by dispatching the OCA\Files\Event\LoadSidebar event while rendering it. Within the files app the sidebar is part of the app layout, so this does nothing.

      Parameters

      • target: HTMLElement

        The element to render the sidebar into

      Returns void

    • Open the sidebar for a specific node.

      When the sidebar is fully opened the files:sidebar:opened event is emitted, see also @nextcloud/event-bus.

      Parameters

      • node: INode

        The node to open the sidebar for

      • Optionaltab: string

        The tab to open by default

      Returns void

    • Register a new sidebar tab. This should ideally be done on app initialization using Nextcloud init scripts.

      Parameters

      Returns void

    • Set the active sidebar tab

      Parameters

      • tabId: string

        The tab to set active

      Returns void

    • Render the sidebar as a fullscreen overlay of the current page.

      Parameters

      • isFullScreen: boolean

        Whether to render the sidebar fullscreen

      Returns void