1.0.12 • Published 3 years ago

@jacob-hooks/use-fade-in v1.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@jacob-hooks/use-fade-in

React Hook to fade in any element.

installation

yarn

yarn add @jacob-hooks/use-fade-in

npm

npm i @jacob-hooks/use-fade-in

Usage

import React from "react";
import useFadeIn from "@jacob-hooks/use-fade-in";

function App() {
  const fadeIn = useFadeIn(5, 10);
  return <h1 {...fadeIn}>This will fade in.</h1>;
}

Arguments

ArgumentTypeDescriptionRequiredDefault value
durationnumberSets the duration of the transition. In secondsno1
delaynumberDelays of transition's start. In secondsno0

Return

useScroll returns an object containing the following:

NameTypeDescription
refReact RefA ref created to fadeIn the element
styleObjectStyle object containing {opacity:0} to give to the element as a default

It's recommended to just spread the returned object on the element as shown in the Usage section above.

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.6

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago