Bootcamp

From idea to product, one lesson at a time. To submit your story: https://tinyurl.com/bootspub1

Member-only story

Revamp Your Accordion Menus: Exploring Captivating Chevron Animations

Mikael Ainalem
Bootcamp
Published in
7 min readJun 2, 2023

--

A picture of stacked paper that resembles the shape of chevrons
Photo by Katie Rainbow 🏳️‍🌈 on Unsplash

There are times when you want to go the extra mile and make some parts of your front-end shine. These are the moments when you want to give your web pages that extra flair and delight your users. If you want user engagement, you need to make your content stand out.

One effective approach is to increase the visibility of common UI elements. Think of checkboxes, radio buttons, text inputs, and other familiar web elements that you encounter every day. The idea here is to ensure that users take notice, especially during mundane activities like form completion, list filtering, or configuration of settings. By elevating these elements, you capture the user’s attention and provide a more enjoyable user experience in various interactions.

Chevrons

Chevrons, those familiar symbols used to indicate the expand/collapse state of accordion menus, are a good example of a UI element that benefits from animations. Instead of simply rotating in place, these chevrons can have a more engaging transformation. Imagine them as flying V shapes, gracefully animating as they transition between open and closed states. In this article, we’ll explore the power of SVG SMIL animations and delve into the fascinating world of enhancing chevron interactions.

Let’s start from the end and have a look what we’re aiming for. Knowing what the end result looks like helps to better understand the different steps involved in developing the animation. Here’s the desired outcome: a chevron that animates smoothly and bends naturally.

An animation of a chevron used together with accordion menus
The mustache chevron transform

The above animation is primarily constructed using two key web concepts viewed from a higher level. They are:

  1. Scalable vector graphics (SVG)
  2. Animation through keyframes

To begin, let’s examine the SVG markup by creating an empty SVG element. Take a look at the following code snippet, which generates a scalable vector of size 16 by 16 pixels. It conveniently uses an…

--

--

Bootcamp
Bootcamp

Published in Bootcamp

From idea to product, one lesson at a time. To submit your story: https://tinyurl.com/bootspub1

Mikael Ainalem
Mikael Ainalem

Written by Mikael Ainalem

Enthusiastic about software & design, father of 3, freelancer and currently CTO at Norban | twitter: https://twitter.com/mikaelainalem