Adding a button to top-navbar through plugin in kibana 6.2.1


(Sunny Sachan) #1

Hi all,

I want to add a button to the top nav bar where fullscreen, share etc button exist in kibana 6.2.1, I am using plugin-generator version 7.0.1 and want that button to be displayed when dashboard tab is selected please anybody do help me.

I am using os windows 10

Thanks in advance.


(Brandon Kobel) #2

Hey @Sunny_Sachan, you can use the NavBarExtensionsRegistryProvider to register your own button, the following is an example:

import { XPackInfoProvider } from 'plugins/xpack_main/services/xpack_info';
import { NavBarExtensionsRegistryProvider } from 'ui/registry/navbar_extensions';

function navbarButtonProvider(Private, $location, dashboardConfig) {
  return {
    appName: '',
    key: '',
    label: '',
    template: `<angular-directive></angular-directive>`,
    description: '',
    hideButton: () => true,
    disableButton: () => true,
    tooltip: () => '',
  };
}

NavBarExtensionsRegistryProvider.register(navbarButtonProvider);

(Sunny Sachan) #3

Many many thanks Brandon for your help here I'll surely try the same and will let you know.


(Sunny Sachan) #4

Hi Brandon,

Many thanks your solution worked well.!

It will be a lot more of your help if you could also help me knowing how to completely hide some of the left panel tabs like management, timelion and devtools from my plugin, if there is any provider for doing the same, please do let me know.

Many thanks in advance.


(Sunny Sachan) #5

Hi Brandon,

Can I also hide some of the existing navbar buttons like share, Clone and Edit buttons through the above "NavBarExtensionsRegistryProvider", if yes can you please help how to do the same, else it would be a lot more of your help if you could tell me how to achieve the same.

Thanks in advance.


(system) #6

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.