npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@b.s/s.o.o.n

v1.0.2

Published

Simple wrappers around [Motion One](https://motion.dev) for React

Downloads

51

Readme

Motion for React

Simple wrappers around Motion One for React

Loosely based on the API for Solid, have taken liberties

Usage

Motion

Renders an animatable HTML or SVG element

Wrap a component in Motion to enable animations on them

<Motion.div>{children}</Motion.div>

Props

  • animate
    • A target of values to animate to
    • On initial render, animate does not run if initial is false or if options are not provided
    • On subsequent renders, animate runs if its options changes
  • initial
    • If options are provided, a target of values to animate to when the element is first rendered
    • If true animates to animate on initial render
  • exit
    • A target of values to animate to when an element is hidden
    • The element must be a direct child of Presence
  • hover
    • A target of values to animate to from animate when the element receives a hover event
    • When the element is not hovered anymore, it animates to animate
  • press
    • A target of values to animate to from animate when the element receives a click event
    • When the element is not pressed anymore, it animates to animate
  • transition
    • Default transitions for all animations to use
    • Animations can specify their own transition to override the defaults
  • inView
    • If true uses default inView options from motion, otherwise specify options
    • Only triggers for initial animations
  • scroll
    • If true uses default scroll options from motion, otherwise specify options
    • Only triggers for initial animations

Presence

Perform exit animations

All direct children of Presence should be Motion and should specify a key, direct children of Presence which are not Motion are filtered out

Exit animations are triggered on children when they are no longer rendered

<Presence>
    {show && <Motion.div key="s.o.o.n">{children}</Motion.div>}
</Presence>

or

<PresenceProvider>
  <Parent>
    <Presence>{children}</Presence>
    <Presence>{children}</Presence>
  <Parent>
<PresenceProvider>

Props

  • id
    • An id for the component
    • Should be used with the hooks useRegisterPresence and usePresence
    • If the parent component needs to know when all exit animations are finished then onExitEnd will trigger a rerender and usePresence stores the exit animation state
  • initial
    • Disable initial animations on all children
  • exitBeforeEnter
    • If true waits until all exiting children animate out before animating in new children
    • Otherwise new children are animated in as exiting children animate out
  • onExitEnd
    • Callback when all exit animations have finished

Contributions

  • Contributions are welcome, just make a pull request

License

See LICENSE

"Let's make something, out of nothing"