How to use the react-spring.config.default function in react-spring

To help you get started, we’ve selected a few react-spring examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github beaverbuilder / assistant / src / front / ui / system / app-frame / index.js View on Github external
const { clientWidth: bodyWidth } = useWindowSize()

	const transform = () => {
		if ( isShowingUI ) {
			return 'translateX( 0% )'
		} else {
			if ( 'end' === alignment ) {
				return 'translateX( 100% )'
			} else {
				return 'translateX( -100% )'
			}
		}
	}

	const springConfig = {
		...config.default,
		tension: 400,
		friction: 33,
		clamp: true,
	}

	const springProps = useSpring( {
		width: width + 1/* account for inside edge border */,
		height,
		right: 'end' === alignment ? 0 : bodyWidth - width,
		transform: transform(),
		immediate: shouldReduceMotion,
		config: springConfig,
	} )

	const insideBorder = '1px solid var(--fl-line-color)'
	const insideEdge = 'end' === alignment ? 'borderLeft' : 'borderRight'
github react-spring / react-spring / examples / demos / bugs / auto-force / index.js View on Github external
render() {
    const { children, className, config, expanded, ...rest } = this.props
    return (
      
        {style => (
          
            {children}
          
        )}
      
    )
  }
}
github madebymany / front-end-london / src / components / Blob / Reveal.js View on Github external
in="SourceGraphic"
                    in2={`goo-${uid}`}
                    operator="atop"
                  />
github DestinyItemManager / DIM / src / app / notifications / Notification.tsx View on Github external
};

  const onMouseOver = () => {
    clearTimer();
    setMouseover(true);
  };

  const onMouseOut = () => {
    setMouseover(false);
    setupTimer();
  };

  const progressBarProps = useSpring({
    from: { width: '0%' },
    to: { width: mouseover || Boolean(!error && !success && notification.promise) ? '0%' : '100%' },
    config: mouseover ? config.default : { ...config.default, duration: notification.duration }
  });

  return (
github joshwcomeau / guppy / src / components / TwoPaneModal / TwoPaneModal.js View on Github external
};
    }
    case 'transitTranslate': {
      return {
        tension: 95,
        friction: 25,
      };
    }
    case 'transitOpacity': {
      return {
        tension: 170,
        friction: 22,
      };
    }
    default: {
      return config.default;
    }
  }
};
github beaverbuilder / assistant / src / front / ui / components / controls / toggle / index.js View on Github external
onClick: e => {
			setValue( ! value )
			onChange( ! value, e )
		},
		role: 'switch',
		'aria-checked': value ? "true" : "false",
		'aria-label': label
	} )
	delete mergedProps.value

	const thumbProps = useSpring( {
		transform: value ? 'translateX(30px)' : 'translateX(0px)',
		background: value ? 'var(--fl-accent-color)' : 'transparent',
		borderColor: value ? 'transparent' : '',
		config: {
			...config.default,
			tension: 700,
			friction: 25,
		},
		immediate: shouldReduceMotion
	} )

	return (
		<button>
			
		</button>
	)
}
github joshwcomeau / guppy / src / components / Sidebar / Sidebar.js View on Github external
const springConfig = key =>
  key === 'sidebarOffsetPercentage'
    ? {
        tension: 200,
        friction: 20,
        precision: 0.75,
      }
    : config.default;
github blockstack / blockstack.org / components / drag / index.js View on Github external
const [{ x }, set] = useSpring(() => ({
    x: 0,
    config: { ...config.default, tension: 200, friction: 30 }
  }))
  let ref = useRef(null)