3.2.0 • Published 9 months ago

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

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months 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.2.0

9 months ago

3.1.0

9 months ago

3.0.2

9 months ago

2.4.2

10 months ago

3.0.1

9 months ago

3.0.0

9 months ago

2.4.1

10 months ago

2.4.0

10 months ago

2.3.8

10 months ago

2.3.7

10 months ago

2.3.9

10 months ago

2.3.2

11 months ago

2.3.4

10 months ago

2.3.3

11 months ago

2.3.6

10 months ago

2.3.5

10 months ago

2.3.13

10 months ago

2.3.12

10 months ago

2.3.14

10 months ago

2.3.11

10 months ago

2.3.10

10 months ago

2.3.1

11 months ago

2.3.0

1 year ago

2.2.20

1 year ago

2.2.21

1 year ago

2.2.19

1 year ago

2.2.18

1 year ago

2.2.17

1 year ago

2.2.15

1 year ago

2.2.16

1 year ago

2.2.13

1 year ago

2.2.14

1 year ago

2.2.12

1 year ago

2.2.11

1 year ago

2.2.10

1 year ago

2.2.9

1 year ago

2.2.8

1 year 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

2 years ago

1.5.4

2 years ago

1.5.3

2 years ago

1.5.2

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.20

2 years ago

1.1.19

2 years ago

1.1.18

2 years ago

1.1.17

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago