How to involve KQL search bar in Kibana Plugin

Are there any ways I can have this KQL search bar in my own plugin? By default, the plugin only contains the time filter on the right.

you can use plugins.data.ui.SearchBar, take a look at how discover, dashboard or visualize app do it.

Is SearchBar included in TopNavMenu? I searched SearchBar in Discover and Dashboard apps and couldn't find it. But I found this: https://github.com/elastic/kibana/tree/7.14/src/plugins/discover/public/application/apps/main/components/top_nav, which looked like something related to SearchBar. Could you help me check this?