# Have searchbar same as dashboard in my custom kibana react plugin(7.6.2)

**URL:** <https://discuss.elastic.co/t/have-searchbar-same-as-dashboard-in-my-custom-kibana-react-plugin-7-6-2/233678>\
**Category:** Kibana\
**Created:** [May 21, 2020, 6:47am UTC](https://discuss.elastic.co/t/have-searchbar-same-as-dashboard-in-my-custom-kibana-react-plugin-7-6-2/233678 "2020-05-21T06:47:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roohani\_Singla](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roohani_singla/32/48235_2.png) [@Roohani\_Singla](https://discuss.elastic.co/u/Roohani_Singla)\
**Post date:** [May 21, 2020, 6:47am UTC](https://discuss.elastic.co/t/have-searchbar-same-as-dashboard-in-my-custom-kibana-react-plugin-7-6-2/233678/1 "2020-05-21T06:47:46Z")

</div>

Hi,  
I want to have same searchbar as dashboard in my custom react plugin which I have created using kbn-plugin-generator. Any possible ways it can be done in Kibana 7.6.2?

---

<div class="post-metadata">

**Author:** ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)\
**Post date:** [May 21, 2020, 7:33pm UTC](https://discuss.elastic.co/t/have-searchbar-same-as-dashboard-in-my-custom-kibana-react-plugin-7-6-2/233678/2 "2020-05-21T19:33:12Z")

</div>

Hi there!

You can use this same search bar! The "data" plugin provides an API for this search bar. To get access to it, you'll first need to add `"data"` to your list of `requiredPlugins` in the `kibana.json` file of your plugin. Then you'll be able to access the component, an example:

```auto
// relative paths assume your plugin is in the ./plugins directory
import { DataPublicPluginStart } from '../src/plugins/data/public';

class MyPlugin {
  setup(core) {
    core.application.register({
      id: 'myApp',
      async mount(context) {
        const [coreStart, pluginsStart] = await core.getStartServices();
        const { SearchBar } = pluginsStart.data.ui;
        // Use the SearchBar component in your app
        ReactDOM.render(<SearchBar />, context.element);
        return () => { ReactDOM.unmountComponentAtNode(element); };
      }
    );
  }
}

```

While we don't have any documentation on this component right now, it is fully typed with TypeScript and the available props are defined here: [https://github.com/elastic/kibana/blob/7.6/src/plugins/data/public/ui/search\_bar/search\_bar.tsx](https://github.com/elastic/kibana/blob/7.6/src/plugins/data/public/ui/search_bar/search_bar.tsx)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 18, 2020, 7:33pm UTC](https://discuss.elastic.co/t/have-searchbar-same-as-dashboard-in-my-custom-kibana-react-plugin-7-6-2/233678/3 "2020-06-18T19:33:13Z")

</div>

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