3.4.0 • Published 1 year ago

@anton.bobrov/react-vevet-hooks v3.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@anton.bobrov/react-vevet-hooks

A collection of custom React hooks designed to seamlessly integrate with the Vevet library, providing enhanced functionalities for your React applications.

Links

Installation

To install the package, use npm:

npm i "@anton.bobrov/react-vevet-hooks"

Usage

Here's an example of how to use one of the hooks, useAnimationFrame, in your component:

import { useAnimationFrame } from '@anton.bobrov/react-vevet-hooks';
import React from 'react';

const MyComponent = () => {
  const { play, pause } = useAnimationFrame({
    onPlay: () => console.log('Animation started'),
    onPause: () => console.log('Animation paused'),
    onFrame: ({ fpsMultiplier }) => {
      console.log('Frame updated, FPS Multiplier:', fpsMultiplier);
    },
  });

  return (
    <div>
      <button onClick={play}>Play</button>
      <button onClick={pause}>Pause</button>
    </div>
  );
};

Available Hooks

Here are available hooks and what they do:

  • useAnimationFrame: Creates an animation frame instance, allowing for customizable animation properties and callbacks.
  • useAnimationFrameSync: Synchronizes animation frame data using linear interpolation.
  • useBreakpointName: Detects the current viewport breakpoint name.
  • useDraggerDirection: Utilizes vevet's DraggerDirection for detecting swipe gestures.
  • useIsMobile: Determines if the current device is mobile.
  • useIsViewportDesktop: Checks if the current viewport breakpoint is 'desktop'.
  • useIsViewportPhone: Checks if the current viewport breakpoint is 'phone'.
  • useIsViewportTablet: Checks if the current viewport breakpoint is 'tablet'.
  • useNonMobileHover: Detects hover state on non-mobile devices.
  • useNonMobilePointerHover: Detects pointer hover state on non-mobile devices.
  • useOnPageLoad: Triggers an effect once the page has fully loaded.
  • useOnResize: Listens for viewport resize events.
  • useOnViewportOritentationChange: Listens for viewport orientation change.
  • useTimeline: Creates a vevet timeline instance and sets up event callbacks for timeline events.
  • useViewportOrientation: Detects the current viewport orientation.
  • useViewportSize: Provides the current size of the viewport.

License

This project is licensed under the terms of the MIT license.

3.4.0

1 year ago

3.3.1

1 year ago

3.3.0

1 year ago

3.2.0

1 year ago

3.1.0

1 year ago

3.0.2

1 year ago

2.4.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.4.1

1 year ago

2.4.0

1 year ago

2.3.8

1 year ago

2.3.7

1 year ago

2.3.9

1 year ago

2.3.2

1 year ago

2.3.4

1 year ago

2.3.3

1 year ago

2.3.6

1 year ago

2.3.5

1 year ago

2.3.13

1 year ago

2.3.12

1 year ago

2.3.14

1 year ago

2.3.11

1 year ago

2.3.10

1 year ago

2.3.1

1 year ago

2.3.0

2 years ago

2.2.20

2 years ago

2.2.21

2 years ago

2.2.19

2 years ago

2.2.18

2 years ago

2.2.17

2 years ago

2.2.15

2 years ago

2.2.16

2 years ago

2.2.13

2 years ago

2.2.14

2 years ago

2.2.12

2 years ago

2.2.11

2 years ago

2.2.10

2 years ago

2.2.9

2 years ago

2.2.8

2 years ago

2.2.7

2 years ago

2.2.6

2 years ago

2.2.5

2 years ago

2.2.4

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.8

2 years ago

2.1.7

2 years ago

2.1.6

2 years ago

2.1.5

2 years ago

2.1.4

2 years ago

2.1.3

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.6.7

2 years ago

1.6.6

2 years ago

1.6.5

2 years ago

1.6.4

2 years ago

1.6.3

2 years ago

1.6.2

2 years ago

1.6.1

2 years ago

1.6.0

3 years ago

1.5.4

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.20

3 years ago

1.1.19

3 years ago

1.1.18

3 years ago

1.1.17

3 years ago

1.1.16

3 years ago

1.1.15

3 years ago

1.1.14

3 years ago

1.1.13

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago