@empathyco/x-components
Version:
Empathy X Components
52 lines (36 loc) • 1.48 kB
Markdown
title: ClearHistoryQueries
# ClearHistoryQueries
A button that when is pressed, emits the
HistoryQueriesXEvents.UserPressedClearHistoryQueries event, expressing the user
intention to clear the whole history of queries.
## Slots
| Name | Description | Bindings<br />(name - type - description) |
| -------------------- | --------------------------------------------------------- | ----------------------------------------- |
| <code>default</code> | (Required) Button content with a message, an icon or both | None |
## Events
A list of events that the component will emit:
- [`UserPressedClearHistoryQueries`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):
the event is emitted after the user clicks the button.
## Examples
### Basic example
The component exposes a single default slot, where you can add icons or text.
```vue live
<template>
<div>
<SearchInput />
<ClearHistoryQueries>Clear history queries</ClearHistoryQueries>
<HistoryQueries :animation="animation" :maxItemsToRender="10" />
</div>
</template>
<script setup>
import { SearchInput } from "@empathyco/x-components/search-box";
import {
HistoryQueries,
ClearHistoryQueries,
} from "@empathyco/x-components/history-queries";
import { FadeAndSlide } from "@empathyco/x-components";
const animation = FadeAndSlide;
</script>
```