1.1.0 • Published 4 years ago

@coveops/toggle-filter v1.1.0

Weekly downloads
23
License
Apache-2.0
Repository
-
Last release
4 years ago

ToggleFilter

The ToggleFilter component displays a toggle switch which the end user can select to filter the query results.

ToggleFilter OFF
image
ToggleFilter ON
image

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/toggle-filter
  1. Use the Component or extend it

Typescript:

import { ToggleFilter, IToggleFilterOptions } from '@coveops/toggle-filter';

Javascript

const ToggleFilter = require('@coveops/toggle-filter').ToggleFilter;
  1. You can also expose the component alongside other components being built in your project.
export * from '@coveops/toggle-filter'
  1. Include the component in your template as follows:
<div class="CoveoToggleFilter"></div>

Extending

Extending the component can be done as follows:

import { ToggleFilter, IToggleFilterOptions } from "@coveops/toggle-filter";

export interface IExtendedToggleFilterOptions extends IToggleFilterOptions {}

export class ExtendedToggleFilter extends ToggleFilter {}

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