🚀 Transition number values using easing functions

Overview

react-transition-value

Transition / Animate number values using easing functions

npm bundle size

⚡️ Getting started

npm i react-transition-value
  import { useTransitionValue } from 'react-transition-value'
  
  const AnimateValue = () => {

    // transitionValue will automatically transition through all values from 0 to 1000
    const [transitionValue, setTransitionValue] = useTransitionValue(0)

    return <button onClick={() => setTransitionValue(1000)}>
      {transitionValue}
    </button>
  }

Api

const [transitionValue, setTransitionValue] = useTransitionValue(from, options)

options

options are not required

Property Type Default Value Description
to number 100 Target value to transition to
from number 0 Initial value to transition from
duration number 200 Transition duration in milliseconds
autoStart boolean false Automatically start the transition
easing function easeOutExpo Easing function used for the transition
onDone function ({from, to}) => {} Called once transition finished
onStep function ({from, to, value}) => {} Called on each transition step

setTransitionValue

allows override of options

setTransitionValue(to, options)
You might also like...

Export AWS SSM Parameter Store values in bulk to .env files

aws-parameter-bulk Utility to read parameters from AWS Systems Manager (SSM) Parameter Store in bulk and output them in environment-file or json forma

Oct 18, 2022

This is a Google Apps Script library for parsing the form object from HTML form and appending the submitted values to the Spreadsheet.

This is a Google Apps Script library for parsing the form object from HTML form and appending the submitted values to the Spreadsheet.

HtmlFormApp Overview This is a Google Apps Script library for parsing the form object from HTML form and appending the submitted values to the Spreads

Oct 23, 2022

This is a library that makes it possible to change the configuration values of the Remix compiler (esbuild).

💽 remix-esbuild-override ⚠️ While I believe you will most likely get a lot of benefit from using this library, it can sometimes destroy your product.

Dec 22, 2022

Compare 👥 and extract 🔬 differences between JSON values

json-changes Easily compare changes in JSON-like values. This can be especially useful when you want to compare an incoming payload with a counterpart

Aug 23, 2022

Tiny and fast utility to extract all possible values for a given enum.

Tiny (208B) and fast utility to extract all possible values for a given enum.

Apr 18, 2022

Generate deterministic fake values: The same input will always generate the same fake-output.

Generate deterministic fake values: The same input will always generate the same fake-output.

import { copycat } from '@snaplet/copycat' copycat.email('foo') // = '[email protected]' copycat.email('bar') // = 'Thurman.Schowalter668@

Dec 30, 2022

A lightweight (~2kB) library to create range sliders that can capture a value or a range of values with one or two drag handles

range-slider-input A lightweight (~2kB) library to create range sliders that can capture a value or a range of values with one or two drag handles. Ex

Dec 24, 2022

An idiomatic way to enforce values not to be null nor undefined, with first-class support for TypeScript

nullthrows An idiomatic way to enforce values not to be null or undefined, with first-class support for TypeScript. Very lightweight with no dependenc

Jul 23, 2022

JavaScript that colors the min / max values of a HTML table.

JavaScript that colors the min / max values of a HTML table.

tableMinMax Übersicht JavaScript that colors the min / max values of a HTML table. JavaScript das die Minimum / Maximum Werte, einer HTML-Tabelle einf

Feb 23, 2022
Color palette generation function using hue cycling and simple easing functions.

Rampensau ?? Color palette generation function using hue cycling and easing functions. Check out a simple demo or see it in action over on farbvelo 10

David Aerne 24 Dec 28, 2022
🧩 TypeScript utility type in order to ensure to return only properties (not methods) containing values in primitive types such as number or boolean (not Value Objects)

?? TypeScript Primitives type TypeScript utility type in order to ensure to return only properties (not methods) containing values in primitive types

CodelyTV 82 Dec 7, 2022
jQuery Easing Plugin

jQuery Easing Plugin What is it? A jQuery plugin from GSGD to give advanced easing options. More info here For CDN please use CloudFlare https://cdnjs

George 914 Nov 10, 2022
Multiplies a number by zero. Useful for when you need to multiply a number by zero

multiply-by-zero Multiplies a number by zero. Useful for when you need to multiply a number by zero Please consider checking out the links of this pro

Dheirya Tyagi 2 Jul 3, 2022
jquery-input-mask-phone-number.js - A simple, easy jquery format phone number mask library

jquery-input-mask-phone-number A jQuery Plugin to make masks on input field to US phone format. Quick start 1. Add latest jQuery and jquery-input-mask

Raja Rama Mohan Thavalam 12 Aug 25, 2022
Custom navigations for Solid written in Typescript. Implement custom page transition logic and ✨ animations ✨

solid-custom-navigation Get, Set, Go! Custom navigations for Solid, written in Typescript. Implement custom page transition logic and ✨ animations ✨ .

Dirag Biswas 8 Nov 27, 2022
A cover page transition based on Vitalii Burhonskyi's Dribbble shot.

Cover Page Transition A cover page transition based on Vitalii Burhonskyi's Dribbble shot. Article on Codrops Demo Installation Install dependencies:

Codrops 37 Dec 31, 2022
Complete, flexible, extensible and easy to use page transition library for your static web.

We're looking for maintainers! Complete, flexible, extensible and easy to use page transition library for your static web. Here's what's new in v2. Ch

null 3.7k Jan 2, 2023
Starter for Next.js projects with a basic page transition logic.

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Antinomy Studio 23 Oct 27, 2022
Functions Recipes is a library of examples to help you getting started with Salesforce Functions and get used to their main features.

Functions Recipes Introduction Salesforce Functions lets you use the Salesforce Platform for building event-driven, elastically scalable apps and expe

Trailhead Apps 172 Dec 29, 2022