# @coveops/have-you-tried

> When you have no results, have you tried will show machine learning query suggestions to try.

Latest version **1.0.0** (published 2020-07-22) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @coveops/have-you-tried
pnpm add @coveops/have-you-tried
yarn add @coveops/have-you-tried
bun add @coveops/have-you-tried
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-07-22 |
| First published | 2020-07-22 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 39.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jfallaire, davebouffard, jmdro, eqcoveo, jfleurent, mthusscoveo, sfecteau, jwolfe-coveo, rvundavalli, gfoumbi, yass1408, coveoit |

## Links

- npm: https://www.npmjs.com/package/@coveops/have-you-tried
- npm.io page: https://npm.io/package/@coveops/have-you-tried

## Dependencies (2)

- [coveo-search-ui](https://npm.io/package/coveo-search-ui.md) ^2.9373.6
- [@coveops/turbo-core](https://npm.io/package/@coveops/turbo-core.md) ^1.1.1

## Recent versions

- 1.0.0 (latest) — 2020-07-22

## README

# have-you-tried

When you have no results, have you tried will show machine learning query suggestions to try.

Disclaimer: This component was built by the community at large and is not an official Coveo JSUI Component. Use this component at your own risk.

## Getting Started

1. Install the component into your project.

```
npm i @coveops/have-you-tried
```

2. Use the Component or extend it

Typescript:

```javascript
import { HaveYouTried, IHaveYouTriedOptions } from '@coveops/have-you-tried';
```

Javascript

```javascript
const have-you-tried = require('@coveops/have-you-tried').HaveYouTried;
```

3. You can also expose the component alongside other components being built in your project.

```javascript
export * from '@coveops/have-you-tried'
```

4. Include the component in your template as follows:



```html
<div class="CoveoHaveYouTried"></div>
```


## Options

The following options can be configured:

| Option | Required | Type | Default | Notes |
| --- | --- | --- | --- | --- |
| `title` | No | string | `<b>No results?</b> You can also try:` | Title rendered |



## Extending

Extending the component can be done as follows:

```javascript
import { HaveYouTried, IHaveYouTriedOptions } from "@coveops/have-you-tried";

export interface IExtendedHaveYouTriedOptions extends IHaveYouTriedOptions {}

export class ExtendedHaveYouTried extends HaveYouTried {}
```


The following methods can be extended to provide additional functionalities or handle more complex use cases.

### applyCommunityUrlRewriter

```javascript
protected renderTitle():string
```

The `renderTitle` should render the title for the component.


## Contribute

1. Clone the project
2. Copy `.env.dist` to `.env` and update the COVEO_ORG_ID and COVEO_TOKEN fields in the `.env` file to use your Coveo credentials and SERVER_PORT to configure the port of the sandbox - it will use 8080 by default.
3. Build the code base: `npm run build`
4. Serve the sandbox for live development `npm run serve`

---
_Source: https://npm.io/package/@coveops/have-you-tried · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
