Skip to content

AnchorScrollTo (todo) JSv0.0.0

The AnchorScrollTo atom is a small interface to the scrollTo utility function from the @studiometa/js-toolkit package.

WARNING

It should be used on <a> elements only.

Table of content

Usage

This component can be directly imported and defined as a dependency of your application and set up to be instanciated on elements matching the a[href^="#"] selector:

js
import { Base, createApp } from '@studiometa/js-toolkit';
import { AnchorScrollTo } from '@studiometa/ui';

class App extends Base {
  static config = {
    name: 'App',
    components: {
      'a[href^="#"]': AnchorScrollTo
    },
  };
}