Skip to main content

Installation

npx shadcn@latest add @kokonutui/slide-text-button

Usage

import SlideTextButton from "@/components/kokonutui/slide-text-button";

export default function Example() {
  return (
    <div className="flex gap-2">
      <SlideTextButton 
        text="Browse Components"
        hoverText="Click to see more"
        href="/components/buttons/particle-button"
      />
      <SlideTextButton 
        text="Get Started"
        href="/docs"
        variant="ghost"
      />
    </div>
  );
}

Props

PropTypeDefaultDescription
textstring"Browse Components"Default text to display
hoverTextstringSame as textText to show on hover
hrefstring"/docs/cards/card"Link destination
variant"default" | "ghost""default"Visual style variant
classNamestring-Additional CSS classes

Variants

Default

Solid black background (white in dark mode) with white text (black in dark mode).

Ghost

Transparent background with border, subtle hover effect.

Dependencies

  • motion/react (Framer Motion) - For text slide animation and entrance effect
  • next/link - For client-side navigation
  • @/lib/utils - Utility functions (cn)

Features

  • Vertical text slide animation on hover
  • Two visual variants (default and ghost)
  • Smooth opacity and transform transitions
  • Entrance animation (slides from right)
  • Responsive width with minimum size
  • Integrated Next.js Link component
  • Dark mode support
  • Works as anchor element with full accessibility

Build docs developers (and LLMs) love