1.0.0 • Published 3 years ago

@ziphooks/use-fade-in v1.0.0

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

@ziphooks/use-fade-in

React Hook for fade in a selected element. Useful on fade motion intro.

Installation

yarn

yarn add @ziphooks/use-fade-in

npm

npm i @ziphooks/use-fade-in

Usage

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

function App() {
  const title = useFadeIn(0.3, 0.5);
  return (
      <h1 ref={title}>Fade In</h1>
  );
};

Arguments

ArgumentTypeDescriptionrequired
DurationNumberA number that duration of fade infalse
DelayNumberA number that delay of fade infalse

Return

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