@varld/fontless-hooks

The hooks used by Varld Fontless.

Usage no npm install needed!

<script type="module">
  import varldFontlessHooks from 'https://cdn.skypack.dev/@varld/fontless-hooks';
</script>

README

Fontless Hooks

The hooks used by Varld Fontless.

Install

npm install @varld/fontless-hooks

# yarn
yarn add @varld/fontless-hooks

Usage

useQuery

The useQuery-hook is a small wrapper around the Next.js router, to easily extract a query parameter.

import { useQuery } from '@varld/fontless-hooks';

// replace `key` with the parameter you want to get
let value = useQuery('key');

useScroll

The useScroll-hook can be used to get the window's horizontal and vertical scroll value. It updates when the user scrolls.

import { useScroll } from '@varld/fontless-hooks';

let { x, y } = useScroll(');

useSize

The useSize-hook can be used to get the size of the browser window. It updates when window is resized.

import { useSize } from '@varld/fontless-hooks';

let { height, width } = useSize(');

License

Powered by Varld

MIT © Tobias Herber