@coveops/toggle-filter
v1.1.0
Published
The `ToggleFilter` component displays a toggle switch which the end user can select to filter the query results.
Downloads
16
Maintainers
Keywords
Readme
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.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. - Build the code base:
npm run build
- Serve the sandbox for live development
npm run serve