1.1.0 • Published 5 years ago
@coveops/toggle-filter v1.1.0
ToggleFilter
The ToggleFilter component displays a toggle switch which the end user can select to filter
the query results.
| ToggleFilter OFF |
|---|
| ToggleFilter ON |
|---|
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
- Install the component into your project.
npm i @coveops/toggle-filter- Use the Component or extend it
Typescript:
import { ToggleFilter, IToggleFilterOptions } from '@coveops/toggle-filter';Javascript
const ToggleFilter = require('@coveops/toggle-filter').ToggleFilter;- You can also expose the component alongside other components being built in your project.
export * from '@coveops/toggle-filter'- 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
- Clone the project
- Copy
.env.distto.envand update the COVEO_ORG_ID and COVEO_TOKEN fields in the.envfile to use your Coveo credentials and SERVER_PORT to configure the port of the sandbox - it will use 8080 by default. - Build the code base:
npm run build - Serve the sandbox for live development
npm run serve