9/18 | Validate feature ideas earlier with AI-driven prototypes

What are best AI tools? Take the State of AI survey

Builder.io
Builder.io
Contact sales

9/18 | Validate feature ideas earlier with AI-driven prototypes

What are best AI tools? Take the State of AI survey

Builder.io
Builder.io
< Back to blog

Web development

Creating a Scrolling Logo Animation with Tailwind CSS

November 8, 2023

Written By Vishwas Gopinath

In this blog post, we'll explore how to create a horizontal scrolling animation using HTML and Tailwind CSS. It can add a visually appealing element to your next landing page.

Generating markup from your design

To begin, we'll use Visual Copilot, an AI powered Figma to Code plugin, to accelerate the process. This tool can convert Figma designs into HTML and Tailwind CSS code, saving us valuable time. Here are the steps:

  • Start with a mockup in Figma, which you can find here.
A list of logos placed horizontally
  • Run Builder.io's Figma plugin, select your design, and click the Generate code button. This action will generate the initial HTML and Tailwind CSS code for you.
Frame selected in Figma with Generate Code button highlighted in the plugin.
copying code generated in Builder
Here's the code generated by Visual Copilot in Quality mode:

Customizing the code

While Visual Copilot accelerates the code generation process, it's important to customize it to match your specific design requirements. Here are some adjustments to consider:

  • Simplify the div class attribute as flex space-x-16 to eliminate unnecessary wrapping and alignment styles.
  • Simplify the img class attribute as max-w-none for each image element.

Here's the updated code:

Applying custom animation

Creating the horizontal scrolling animation is straightforward. We just have to shift the div element leftward from 0 to -100%. Tailwind CSS does not come with this exact animation pre-configured, so we will need to set it up manually within our tailwind.config file.

To extend the list of Tailwind animations, we update theme.extend.animation in the tailwind.config.js file. To add new animation @keyframes, update theme.extend.keyframes :

animation: 'loop-scroll 50s linear infinite': This line defines an animation called loop-scroll. It is assigned a duration of 50 seconds, a linear timing function (meaning it progresses at a constant speed), and it is set to run infinitely, which means it will keep looping without stopping.

keyframes: {...}: Here, you define the keyframes for the loop-scroll animation using an object. Keyframes are a way to specify how an animation should progress over time. In this case, the loop-scroll animation involves moving an element horizontally from left to right (transforming its X position).

Back in the HTML tab in the playground, specify the class animate-loop-scroll on the div element.

When you take a look at the UI, the animation will appear to operate flawlessly. But, there's a slight problem: the div element abruptly resets to the starting position after completing its movement, creating a jarring effect instead of a continuous loop.

Achieving seamless looping

To ensure seamless scrolling, we're going to implement a neat trick. By duplicating the div element and positioning it directly behind the original, we can create the illusion of a never-ending animation.

As the first element reaches -100% of its journey, the second element will seamlessly follow, creating a continuous flow of content that maintains the smoothness of the animation. We will enclose the two lists in a wrapping div element and position them next to each other. We will also add the aria-hidden attribute on the second list to hide from screen readers.

The animation is now seamless and never-ending!

Pausing the animation on hover

For an interactive touch, let's make the animation pause when a user hovers over it. To achieve this, create a custom utility class in Tailwind CSS. In the CSS tab in Tailwind playground, add the paused class.

To apply styles to an element that are dependent on the state of a parent element, you can use the group class on the parent. Then, you can take advantage of group-* modifiers, such as group-hover, to fine-tune the styling of the child element.

In our example, assign the group class to the outer div element, and for each inner div element, enhance it with the group-hover:paused class to pause the animation.

Now, when a user hovers over the list, the animation will pause, letting them explore the logos at their own pace.

Here’s the final code for scrolling logo animation with Tailwind CSS:

Share

Twitter
LinkedIn
Facebook
Share this blog
Copy icon
Twitter "X" icon
LinkedIn icon
Facebook icon

Visually edit your codebase with AI

Using simple prompts or Figma-like controls.

Try it nowGet a demo

Design to Code Automation

A pragmatic guide for engineering leaders and development teams


Continue Reading
design9 MIN
How to generate (actually good) designs with AI
September 17, 2025
AI9 MIN
7 Levels of Context Engineering for Designers
September 16, 2025
Design to Code8 MIN
Git Branching for Designers
September 11, 2025

Product

Visual CMS

Theme Studio for Shopify

Sign up

Login

Featured Integrations

React

Angular

Next.js

Gatsby

Resources

User Guides

Developer Docs

Forum

Blog

Github

Get In Touch

Chat With Us

Twitter

Linkedin

Careers

© 2020 Builder.io, Inc.

Security

Privacy Policy

Terms of Service

Get the latest from Builder.io

By submitting, you agree to our Privacy Policy

  • Fusion

  • Publish

  • Product Updates

  • Design to Code

  • Headless CMS

    Multi-Brand CMS

  • Landing Pages

  • Web Apps

  • Prototypes

  • Marketing Sites

  • Headless Commerce

  • Documentation

  • Fusion Docs

  • Publish Docs

  • Blog

  • Webinars

  • Guides

  • Case Studies

  • Community Forum

  • Partners

  • Affiliate Program

  • CMS Integrations

  • CMS Blueprints

  • Glossary

  • Figma to Code Guide

  • Headless CMS Guide

  • Headless Commerce Guide

  • Composable DXP Guide

  • About

  • Careers

  • Contact Sales

Security

Privacy Policy

SaaS Terms

Compliance

Cookie Preferences

YouTube icon
Github icon
Blsky Icon
Twitter "X" icon
LinkedIn icon
Feed Icon
Gartner Cool Vendor 2024