# SelectedFilter & ResetSearchButton

**URL:** <https://discuss.elastic.co/t/selectedfilter-resetsearchbutton/275284>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [June 8, 2021, 10:10am UTC](https://discuss.elastic.co/t/selectedfilter-resetsearchbutton/275284 "2021-06-08T10:10:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mariobg](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mariobg](https://discuss.elastic.co/u/mariobg)\
**Post date:** [June 8, 2021, 10:10am UTC](https://discuss.elastic.co/t/selectedfilter-resetsearchbutton/275284/1 "2021-06-08T10:10:03Z")

</div>

Hello, is there some provision to make the a SelectedFilter components where the selected filters are easily seen and from where they can be deselected. And a ResetSearchButton component with which to clean all filters easily.

Other solutions like Searchkit have these components and the truth is that they are very useful and here they are missing.

I share the links where you can see them.  
[https://searchkit.co/docs/build-your-own-components/selected-filters](https://searchkit.co/docs/build-your-own-components/selected-filters)

> **[searchkit/packages/searchkit-elastic-ui/src/SelectedFilters at next ·...](https://github.com/searchkit/searchkit/tree/next/packages/searchkit-elastic-ui/src/SelectedFilters)**
>
> next/packages/searchkit-elastic-ui/src/SelectedFilters

> **[searchkit/packages/searchkit-elastic-ui/src/ResetSearchButton at next ·...](https://github.com/searchkit/searchkit/tree/next/packages/searchkit-elastic-ui/src/ResetSearchButton)**
>
> next/packages/searchkit-elastic-ui/src/ResetSearchButton

Maybe some body has implemented them for Elastic App Search by their own and would like to share them. Thanks

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [June 8, 2021, 12:26pm UTC](https://discuss.elastic.co/t/selectedfilter-resetsearchbutton/275284/2 "2021-06-08T12:26:35Z")

</div>

We don't have those currently in search-ui. You'll have to build them yourself. The actions are available you just need to build a component for them: [search-ui/ADVANCED.md at master · elastic/search-ui · GitHub](https://github.com/elastic/search-ui/blob/master/ADVANCED.md#build-your-own-component).

For instance, a reset button:

```auto
import React from "react";
import { withSearch } from "@elastic/react-search-ui";

function Reset({ reset }) {
  return (
    <div>
      <button onClick={() => reset()}>
        Reset
      </button>
    </div>
  );
}

export default withSearch(({ reset }) => ({
  reset
}))(Reset);

```

Or a filter component:

```auto
import React from "react";
import { withSearch } from "@elastic/react-search-ui";

function SelectedFilters({ filters, removeFilter }) {
  // iterate through filters, print them to the page, and add a `removeFilter` click action
}

export default withSearch(({ filters, removeFilter }) => ({
  filters, removeFilter
}))(SelectedFilters);

```

---

<div class="post-metadata">

**Author:** ![mariobg](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mariobg](https://discuss.elastic.co/u/mariobg)\
**Post date:** [June 9, 2021, 7:24am UTC](https://discuss.elastic.co/t/selectedfilter-resetsearchbutton/275284/3 "2021-06-09T07:24:50Z")

</div>

> [@JasonStoltz](#):
>
> `() => reset()`

Thanks Jason,  
I'll try and tell you if I manage to do it. I am not familiar with React programming.  
I hope they are available soon in search-ui

---

<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:** [July 7, 2021, 7:25am UTC](https://discuss.elastic.co/t/selectedfilter-resetsearchbutton/275284/4 "2021-07-07T07:25:47Z")

</div>

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