🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@coveops/back-to-top

Package Overview
Dependencies
Maintainers
21
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coveops/back-to-top

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.

latest
Source
npmnpm
Version
1.2.2
Version published
Weekly downloads
2
Maintainers
21
Weekly downloads
 
Created
Source

BackToTop

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/back-to-top
  • Use the Component or extend it

Typescript:

import { BackToTop, IBackToTopOptions } from '@coveops/back-to-top';

Javascript

const BackToTop = require('@coveops/back-to-top').BackToTop;
  • You can also expose the component alongside other components being built in your project.
export * from '@coveops/back-to-top'
  • Or for quick testing, you can add the script from unpkg
<script src="https://unpkg.com/@coveops/back-to-top@latest/dist/index.min.js"></script>

Disclaimer: Unpkg should be used for testing but not for production.

  • Include the component in your template as follows:

Place the component in your markup:

<div class="CoveoBackToTop"></div>

Options

The following options can be configured:

OptionRequiredTypeDefaultNotes
titleCaptionNostringBack to TopSpecifies value for the element's title attribute.
textCaptionNostringBack to TopSpecifies the text value of the button.
scrollBehaviorNostringautoSpecifies the scroll behavior. Can be auto or smooth.
shouldBeLocalizedNobooleanfalseSpecifies whether to translate the button value.

Extending

Extending the component can be done as follows:

import { BackToTop, IBackToTopOptions } from "@coveops/back-to-top";

export interface IExtendedBackToTopOptions extends IBackToTopOptions {}

export class ExtendedBackToTop extends BackToTop {}

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

FAQs

Package last updated on 16 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts