CopyToClipboard
Allows the user to copy a value to their clipboard.
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/copy-to-clipboard
- Import fontawesome into the markup
<script src="https://kit.fontawesome.com/515c3b5b58.js" crossorigin="anonymous"></script>
- Use the Component or extend it
Typescript:
import { CopyToClipboard, ICopyToClipboardOptions } from '@coveops/copy-to-clipboard';
Javascript
const CopyToClipboard = require('@coveops/copy-to-clipboard').CopyToClipboard;
- You can also expose the component alongside other components being built in your project.
export * from '@coveops/copy-to-clipboard'
- Include the component in your template as follows:
Place the component after the last tab in the coveo-tab-section
<div class="CoveoCopyToClipboard"></div>
Extending
Extending the component can be done as follows:
import { CopyToClipboard, ICopyToClipboardOptions } from "@coveops/copy-to-clipboard";
export interface IExtendedCopyToClipboardOptions extends ICopyToClipboardOptions {}
export class ExtendedCopyToClipboard extends CopyToClipboard {}
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