0.1.0 • Published 5 years ago
@varld/hooks v0.1.0
Fontless Hooks
The hooks used by Varld Fontless.
Install
npm install @varld/fontless-hooks
# yarn
yarn add @varld/fontless-hooksUsage
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
0.1.0
5 years ago