Interactive Micro-Interaction•Slide-Up Text Roll
Animated Slide-Up Button
High-converting dual-text roll CTA button. Hovering replaces the primary label with a secondary action message through smooth vertical translation with overflow clipping.
preview.tsx
Hover to trigger the dual-label slide
Customizer
PRESETS & VARIATIONS
All Variants Preview
Hover over each variant to preview interaction
Primary Darkvariant="primary"
Dark obsidian background with clean white typography
Secondary Lightvariant="secondary"
High-contrast white pill with crisp dark border
Conversion RollCustom Labels
Compelling deal incentive trigger on hover
Outline Documentationvariant="secondary"
Secondary navigation & technical documentation CTA
Installation & Setup
This component is lightweight and built with Tailwind CSS transitions:
npm install clsx tailwind-merge
Code & Integration
AnimatedButton.tsx• Production Ready
"use client";
import React from "react";
export interface AnimatedSlideButtonProps {
primaryText: string;
hoverText?: string;
variant?: "primary" | "secondary";
onClick?: () => void;
className?: string;
}
export function AnimatedSlideButton({
primaryText,
hoverText = "See More →",
variant = "primary",
onClick,
className = "",
}: AnimatedSlideButtonProps) {
const variantStyles =
variant === "primary"
? "bg-black text-white hover:bg-neutral-800"
: "bg-white text-black border-2 border-black hover:bg-neutral-100";
return (
<button
type="button"
onClick={onClick}
className={`group relative px-8 py-4 rounded-[20px] font-semibold text-sm transition-all duration-300 overflow-hidden cursor-pointer select-none ${variantStyles} ${className}`}
>
<div className="flex flex-col items-center justify-center max-h-[22px] overflow-hidden">
<span className="transition-transform duration-300 ease-in-out transform group-hover:translate-y-[40px] translate-y-2.5">
{primaryText}
</span>
<span className="transition-transform duration-300 ease-in-out transform translate-y-[40px] group-hover:-translate-y-2.5 font-bold">
{hoverText}
</span>
</div>
</button>
);
}
export default AnimatedSlideButton;Component API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| primaryText | string | "Explore Services" | Initial text displayed in resting state |
| hoverText | string | "See More →" | Secondary text revealed upon hover roll |
| variant | "primary" | "secondary" | "primary" | Dark or Light styling mode |
| onClick | () => void | undefined | Click callback event handler |
Personalized Help
Struggling with animated roll buttons or high-converting micro-interactions? Let's talk about your product.
UI Pirate is a product design & development agency trusted by 50+ SaaS founders and enterprise teams across the US, UK & beyond. Tell us what you need.