Arrow Slide Button

Arrow icon slides in from the left on hover while the label glides right.

Tailwind CSS
<button class="group inline-flex items-center gap-2 overflow-hidden rounded-xl bg-neutral-900 px-6 py-3 font-semibold text-white dark:bg-white dark:text-neutral-900">
  <svg class="h-5 w-5 -translate-x-8 opacity-0 transition-all duration-300 group-hover:translate-x-0 group-hover:opacity-100" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
    <path stroke-linecap="round" stroke-linejoin="round" d="M13 7l5 5-5 5M6 12h12"></path>
  </svg>
  <span class="-ml-7 transition-all duration-300 group-hover:ml-0">Get started</span>
</button>

Free to use in personal and commercial projects. No attribution required.

Variants

Same component, different looks. Preview each one live and copy the code you like.

Indigo

The indigo version works as a primary CTA on light marketing pages.

Tailwind CSS

Pill

The pill shape feels friendlier and suits onboarding flows and mobile screens.

Tailwind CSS

Light outline

The light outline version fits secondary links like documentation or help pages.

Tailwind CSS

About this arrow slide button

The arrow slide button adds a small moment of motion to an otherwise static CTA. At rest it looks like a plain button, but on hover an arrow glides in from the left edge and the label shifts right to make room. It signals forward movement, which is why it works so well on next-step actions.

The arrow starts translated off-canvas with opacity-0, and the label carries -ml-7 so it sits where the arrow will land. On group-hover both animate: the arrow slides to its natural spot and fades in while the label margin eases back to zero. The shared duration-300 keeps the two motions synchronized so it feels like one gesture.

Use it on get-started buttons, wizard next steps, read-more links styled as buttons, and carousel controls. Because the resting state is a normal readable button, touch users lose nothing.

Static call-to-action buttons blend into the page; the eye skips over what never moves. A small arrow that glides in on hover breaks that stillness and points the user toward the next step, which is why this pattern dominates Continue, Next, and Learn more actions. The motion costs almost nothing but lifts the click-through feel of the whole page.

The trick is a two-part choreography: the arrow hides off-canvas at -translate-x-8 and opacity-0 while the label holds its future position with -ml-7, so when hover fires the arrow slides into space that was already reserved. On group-hover, both transition over 300 milliseconds: the arrow slides to its natural position and fades in as the label's negative margin eases back to zero. Because the arrow is out of flow at rest, the button's resting width already accounts for the final layout.

Point the arrow with intent: right for forward actions like Continue and Next, left for Back, up-right for external links. In RTL layouts, mirror the arrow direction along with the text or the motion reads backwards. For destructive actions, drop the arrow entirely; a Delete button should feel final, not inviting. The arrow is a promise of what happens next, so never put it on a button that opens a surprise modal.

The mistake is letting the label shift resize the button. If the button is inline-flex with tight padding, the margin easing changes its width mid-animation and nearby content jumps sideways. Keep generous horizontal padding or set a min-width so the button's box stays rock solid while the arrow glides in.

Where to use it

  • ✓ Get started and sign up CTAs on landing pages
  • ✓ Next step buttons in multi-step forms and wizards
  • ✓ Read more links styled as buttons on blog cards
  • ✓ Carousel and slider navigation controls

Customization tips

Flip the direction by translating the arrow from the right and mirroring the margins for a back button. Change duration-300 for a snappier or lazier slide, and swap the arrow path for a chevron or external-link icon to match your meaning.

Design notes

When to use

The sliding arrow adds a sense of forward motion to calls to action like Continue or View details, where the direction of the arrow matches the user's next step. The animation rewards the hover with a small delight that makes the button feel responsive and alive. It fits marketing pages and onboarding flows where a little personality helps conversion.

What to avoid

Do not use the slide on buttons where the arrow direction would lie, like a back button with a right-pointing arrow. Avoid the effect on critical destructive actions, playfulness undermines the seriousness of Delete forever. And do not stack multiple animated hovers on one button, the arrow plus a color shift plus a scale quickly feels busy.

Accessibility

Respect prefers-reduced-motion by showing the arrow statically instead of animating it in. The arrow is decorative, so hide it from screen readers and let the button label speak.

Frequently asked questions

Does the effect work on touch screens?

There is no hover on touch, so mobile users simply see the resting button with its full label. The design degrades gracefully because nothing essential is hidden behind the hover.

Why does the label use -ml-7?

The hidden arrow still occupies space in the flex row: 20px of icon plus the 8px gap. The negative margin pulls the label left by exactly that amount so the resting button looks normally centered, then it relaxes to ml-0 on hover.

Can I use this in a right-to-left layout?

Mirror it: place the arrow after the label, translate it from the right, and flip the margin utilities. The motion then reads correctly for RTL readers.

How do I add the sliding arrow to a Learn more link?

The same trick works on a plain anchor: wrap the arrow in a span with translate-x-0 and move it to translate-x-1 on group-hover. You do not need a button element for this. Keep the transition on transform only so the animation stays smooth at 60fps.

Why does the arrow not slide on my phone?

Touch screens have no persistent hover, so the slide either never triggers or sticks after a tap. Wrap the hover styles in a hover: hover and pointer: fine media query when the slide is decorative. For critical calls to action, make the arrow visible by default on touch layouts instead of hiding it behind a hover.

How do I make the arrow slide farther on hover?

Increase the translate value on hover, for example from translate-x-1 to translate-x-2, and bump the duration to 300ms so the longer travel still feels relaxed. If the arrow jumps instead of sliding, check that both the resting and hover states set a translate class on the same element.

Customize it with our tools