Animated icon
The Animated Icon component is used to display animated visual representations that enhance user experience by conveying actions, statuses, or interactive elements more effectively than static icons. It is intended for dynamic visual feedback in the UI.
Examples
<script>
export default {
data() {
return {
animationsOn: false,
};
},
};
</script>
<template>
<div class="gl-flex gl-gap-3 gl-flex-wrap hover:gl-cursor-pointer gl-select-none" @click="animationsOn = !animationsOn">
<div class="gl-p-4 gl-bg-strong gl-rounded-default gl-grid gl-place-items-center gl-text-sm gl-leading-16 gl-gap-2">
<gl-animated-todo-icon name="todo" :isOn="animationsOn" />
<span>todo</span>
</div>
<div class="gl-p-4 gl-bg-strong gl-rounded-default gl-grid gl-place-items-center gl-text-sm gl-leading-16 gl-gap-2">
<gl-animated-star-icon name="star" :isOn="animationsOn" />
<span>star</span>
</div>
<div class="gl-p-4 gl-bg-strong gl-rounded-default gl-grid gl-place-items-center gl-text-sm gl-leading-16 gl-gap-2">
<gl-animated-sort-icon name="sort" :isOn="animationsOn" />
<span>sort</span>
</div>
<div class="gl-p-4 gl-bg-strong gl-rounded-default gl-grid gl-place-items-center gl-text-sm gl-leading-16 gl-gap-2">
<gl-animated-smile-icon name="smile" :isOn="animationsOn" />
<span>smile</span>
</div>
<div class="gl-p-4 gl-bg-strong gl-rounded-default gl-grid gl-place-items-center gl-text-sm gl-leading-16 gl-gap-2">
<gl-animated-sidebar-icon name="sidebar" :isOn="animationsOn" />
<span>sidebar</span>
</div>
<div class="gl-p-4 gl-bg-strong gl-rounded-default gl-grid gl-place-items-center gl-text-sm gl-leading-16 gl-gap-2">
<gl-animated-notification-icon name="notifications" :isOn="animationsOn" />
<span>notifications</span>
</div>
<div class="gl-p-4 gl-bg-strong gl-rounded-default gl-grid gl-place-items-center gl-text-sm gl-leading-16 gl-gap-2">
<gl-animated-chevron-right-down-icon name="chevron_right_down" :isOn="animationsOn" />
<span>chevron-right-down</span>
</div>
<div class="gl-p-4 gl-bg-strong gl-rounded-default gl-grid gl-place-items-center gl-text-sm gl-leading-16 gl-gap-2">
<gl-animated-chevron-lg-right-down-icon name="chevron_lg_right_down" :isOn="animationsOn" />
<span>chevron-lg-right-down</span>
</div>
<div class="gl-p-4 gl-bg-strong gl-rounded-default gl-grid gl-place-items-center gl-text-sm gl-leading-16 gl-gap-2">
<gl-animated-chevron-down-up-icon name="chevron_down_up" :isOn="animationsOn" />
<span>chevron-down-up</span>
</div>
<div class="gl-p-4 gl-bg-strong gl-rounded-default gl-grid gl-place-items-center gl-text-sm gl-leading-16 gl-gap-2">
<gl-animated-chevron-lg-down-up-icon name="chevron_lg_down_up" :isOn="animationsOn" />
<span>chevron-lg-down-up</span>
</div>
</div>
</template><script>
export default {
data() {
return {
animationsOn: false,
};
},
};
</script>
<template>
<div class="gl-flex gl-gap-3 gl-flex-wrap gl-select-none">
<div class="gl-p-4 gl-bg-strong gl-rounded-default gl-grid gl-place-items-center gl-text-sm gl-leading-16 gl-gap-2" @mouseenter="animationsOn = true" @mouseleave="animationsOn = false">
<gl-animated-upload-icon name="upload" :isOn="animationsOn" />
<span>upload</span>
</div>
<div class="gl-p-4 gl-bg-strong gl-rounded-default gl-grid gl-place-items-center gl-text-sm gl-leading-16 gl-gap-2" @mouseenter="animationsOn = true" @mouseleave="animationsOn = false">
<gl-animated-duo-chat-icon name="duo_chat" :isOn="animationsOn" />
<span>duo-chat</span>
</div>
<div class="gl-p-4 gl-bg-strong gl-rounded-default gl-grid gl-place-items-center gl-text-sm gl-leading-16 gl-gap-2" @mouseenter="animationsOn = true" @mouseleave="animationsOn = false">
<gl-animated-loader-icon name="loader" :isOn="animationsOn" />
<span>loader</span>
</div>
</div>
</template>Guidelines
When to use
- To indicate loading states or transitions.
- To provide visual emphasis for an interactive element.
- To enhance engagement with subtle motion feedback.
| Icon name | User action | When to use |
|---|---|---|
GlAnimatedChevronRightDownIcon, GlAnimatedChevronLgRightDownIcon | Click, expand a section | Accordion component, settings section, global navigation section |
GlAnimatedChevronDownUpIcon, GlAnimatedChevronLgDownUpIcon | Click | Comment block, CRUD component, dropdown component |
GlAnimatedDuoChatIcon | Hover | GitLab Duo chat button |
GlAnimatedLoaderIcon | — | Loading state, GitLab Duo writing an answer |
GlAnimatedNotificationIcon | Click | Subscribe/unsubscribe button |
GlAnimatedSidebarIcon | Click | Show/hide a sidebar button |
GlAnimatedSmileIcon | Hover | Add reaction button |
GlAnimatedSortIcon | Click | Sort button |
GlAnimatedStarIcon | Click | Star/unstar button |
GlAnimatedTodoIcon | Click | Add/remove from todo list button |
GlAnimatedUploadIcon | Hover | Drop zone |
When not to use
- For essential UI actions where animation might cause unnecessary distraction.
- In places where a static icon can sufficiently communicate the message.
- If excessive animations could negatively impact performance.
Categories
Accessibility
- Use
aria-labelto describe the purpose of the animation for screen readers. - Ensure that animations are subtle and do not trigger motion sensitivity issues.
- Allow users to disable animations where necessary.
Code reference
GlAnimatedChevronDownUpIcon
import { GlAnimatedChevronDownUpIcon } from '@gitlab/ui'; Props
Name | Description | Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
GlAnimatedChevronLgDownUpIcon
import { GlAnimatedChevronLgDownUpIcon } from '@gitlab/ui'; Props
Name | Description | Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
GlAnimatedChevronLgRightDownIcon
import { GlAnimatedChevronLgRightDownIcon } from '@gitlab/ui'; Props
Name | Description | Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
GlAnimatedChevronRightDownIcon
import { GlAnimatedChevronRightDownIcon } from '@gitlab/ui'; Props
Name | Description | Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
GlAnimatedDuoChatIcon
import { GlAnimatedDuoChatIcon } from '@gitlab/ui'; Props
Name | Description | Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
GlAnimatedLoaderIcon
import { GlAnimatedLoaderIcon } from '@gitlab/ui'; Props
Name | Description | Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
GlAnimatedNotificationIcon
import { GlAnimatedNotificationIcon } from '@gitlab/ui'; Props
Name | Description | Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
GlAnimatedSidebarIcon
import { GlAnimatedSidebarIcon } from '@gitlab/ui'; Props
Name | Description | Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
GlAnimatedSmileIcon
import { GlAnimatedSmileIcon } from '@gitlab/ui'; Props
Name | Description | Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
GlAnimatedSortIcon
import { GlAnimatedSortIcon } from '@gitlab/ui'; Props
Name | Description | Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
GlAnimatedStarIcon
import { GlAnimatedStarIcon } from '@gitlab/ui'; Props
Name | Description | Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
GlAnimatedTodoIcon
import { GlAnimatedTodoIcon } from '@gitlab/ui'; Props
Name | Description | Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
GlAnimatedUploadIcon
import { GlAnimatedUploadIcon } from '@gitlab/ui'; Props
Name | Description | Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
Last updated at: