×

Femtality- -v0.16.1- — By Aerisetta

function useFemtState(initial) { const s = state(initial); useEffect(() => () => s.destroy && s.destroy(), []); return s; }

import { useEffect } from 'react'; import { state } from 'femtality'; FEMTALITY- -v0.16.1- By Aerisetta

// bindStyle sets inline style properties reactively bindStyle(document.querySelector('.bar'), t => ({ width: `${progress.value}%` })); s.destroy && s.destroy()

Example: animate a progress bar

import { behavior } from 'femtality';

const t = transition(progress, { duration: 600, easing: 'easeOutQuad' }); import { state } from 'femtality'

function useFemtState(initial) { const s = state(initial); useEffect(() => () => s.destroy && s.destroy(), []); return s; }

import { useEffect } from 'react'; import { state } from 'femtality';

// bindStyle sets inline style properties reactively bindStyle(document.querySelector('.bar'), t => ({ width: `${progress.value}%` }));

Example: animate a progress bar

import { behavior } from 'femtality';

const t = transition(progress, { duration: 600, easing: 'easeOutQuad' });