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

@carbon/icons-motion

v2.3.0

Published

Animated icons based on Carbon icons

Downloads

2,704

Readme

Carbon Icon Animations

This is a package of animated icons which mirrors the icons in Carbon Design System icons. It enables developers to import an animated icon directly from this library, in place of importing the existing static icon from the Carbon Design System library. The animated icons are implemented as React components. Since they do not make use of Carbon's icon components directly, they are not tied to a specific version of Carbon, and can be used in any React project.

Check out what the animations look like in this example app.

We will be adding onto this library one category at a time - the current release includes the Navigation icons and Operations icons. The Formatting icons are currently in progress, and toggle icons are being worked on as well.
If you want to request an icon/category to be animated, please open an issue using the New icon animation template. Working together with the Carbon team, we will prioritize the categories that will be most frequently used.

We will do our very best to keep these icons in sync with the Carbon icons but if there is a change to the Carbon icon, it may not yet be reflected in our library- if you encounter this, please open a Update icon animation issue to alert us.

Using the icons

Installation

To use the icons in your project, first install the package:

npm install @carbon/icons-motion

Usage

Example: How to import and use the icon component and CSS file from the package.

This example shows how to import one specific icon HomeMotion and use it a component in an app.

App.js

import { HomeMotion } from '@carbon/icons-motion'
import '@carbon/icons-motion/dist/index.css'

const myComponent = () => <HomeMotion isAnimating={false} size={32} />

The component takes two props:

  • isAnimating is a boolean; to trigger the animation, change this prop to true
  • size is an integer which will set the width and height of the icon in px

Important Your app will need to update the isAnimating prop to true in order to make the icon animate. You can decide when/how this prop change should be triggered, depending on your specific use case.

Example: Here's how to make an icon animate on mouseEnter of the div with the className of icon-tile, similar to the examples shown in the demo app at ./example/src/components/NavigationSection folder.

Note in this example, all icons are imported as * so to use the specific icon, use <icons.IconName>

App.js

import React, { useState } from 'react'
import * as icons from '@carbon/icons-motion'
import '@carbon/icons-motion/dist/index.css'

const [homeAnimating, setHomeAnimating] = useState(false)

function App() {
  return (
    <div className='App'>
      <div
        className='icon-tile'
        onMouseEnter={() => setHomeAnimating(true)}
        onMouseLeave={() => setHomeAnimating(false)}
      >
        <h3>Home</h3>
        <icons.HomeMotion isAnimating={homeAnimating} size={32} />
      </div>
    </div>
  )
}

export default App

Additional examples coming soon!

Contributing

We welcome everyone who would like to contribute! Check out our Contribution guidelines to get started, and don't hesitate to reach out if you have any questions!

All Contributors table coming soon!

Feedback

This library is in constant evolution, and we welcome any feedback to help it improve!

We'd especially love feedback in the following areas:

  • New icons needed - propose additional icons you would like to see animated
  • Animation feedback - too fast/slow/bouncy/whatever; conformance to existing animation guidelines
  • Package feedback - improvements to code quality, efficiency, dependencies etc related to the actual package icon components
  • Example app feedback - ideas on how to make the included demo app super engaging
  • Documentation feedback - Is the ReadMe clear? Did you have the information you needed to successfully edit/create icons, or use icons in your project?
  • Implementation feedback - Did the icons work for your use case? Did you need different props?

Contributors

This effort is lead by the Animated Icon Workgroup members: @kristastarr, @johnbister, @Motion-Mike, @silvio-hajdin

IBM Telemetry

This package uses IBM Telemetry to collect metrics data. By installing this package as a dependency you are agreeing to telemetry collection. To opt out, see Opting out of IBM Telemetry data collection. For more information on the data being collected, please see the IBM Telemetry documentation.

License

Licensed under the Apache 2.0 License.