https://github.com/carbon-design-system/icons-motion
A library of animated Carbon icons
https://github.com/carbon-design-system/icons-motion
animation css hacktoberfest javascript microinteractions react
Last synced: 8 months ago
JSON representation
A library of animated Carbon icons
- Host: GitHub
- URL: https://github.com/carbon-design-system/icons-motion
- Owner: carbon-design-system
- License: apache-2.0
- Created: 2022-09-28T19:43:22.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-09-08T01:46:31.000Z (10 months ago)
- Last Synced: 2025-09-13T22:52:45.105Z (9 months ago)
- Topics: animation, css, hacktoberfest, javascript, microinteractions, react
- Language: JavaScript
- Homepage:
- Size: 9.75 MB
- Stars: 20
- Watchers: 4
- Forks: 11
- Open Issues: 69
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Carbon Icon Animations
This is a package of animated icons which mirrors the icons in [Carbon Design System](https://carbondesignsystem.com/guidelines/icons/library/) 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](https://carbon-design-system.github.io/icons-motion/).
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:
```bash
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
```jsx
import { HomeMotion } from '@carbon/icons-motion'
import '@carbon/icons-motion/dist/index.css'
const myComponent = () =>
```
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 ``
App.js
```jsx
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 (
setHomeAnimating(true)}
onMouseLeave={() => setHomeAnimating(false)}
>
Home
)
}
export default App
```
Additional examples coming soon!
## Contributing
We welcome everyone who would like to contribute! Check out our [Contribution guidelines](https://github.com/carbon-design-system/icons-motion/blob/main/.github/CONTRIBUTING.md) to get started, and don't hesitate to reach out if you have any questions!
[All Contributors](https://github.com/all-contributors/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](https://github.com/ibm-telemetry/telemetry-js/tree/main#opting-out-of-ibm-telemetry-data-collection).
For more information on the data being collected, please see the
[IBM Telemetry documentation](https://github.com/ibm-telemetry/telemetry-js/tree/main#ibm-telemetry-collection-basics).
## License
Licensed under the [Apache 2.0 License](https://github.com/carbon-design-system/carbon-motion/blob/main/LICENSE).