Buttons
Ripple Button
Interactive button with animated ripple effects and multiple variants. Perfect for React applications requiring engaging button interactions with Next.js integration and TypeScript support.
Powered by
Installation
npx shadcn@latest add https://www.shadcn.io/registry/ripple-button.json
npx shadcn@latest add https://www.shadcn.io/registry/ripple-button.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/ripple-button.json
bunx shadcn@latest add https://www.shadcn.io/registry/ripple-button.json
Features
- Animated ripple effects that originate from click position with customizable scale and timing
- Multiple button variants including default, destructive, outline, secondary, and ghost styles
- Size variations with responsive scaling (sm, default, lg, icon) using class-variance-authority
- Motion interactions with hover and tap scale effects using Framer Motion
- TypeScript support with complete interface definitions and variant types
- shadcn/ui integration using design tokens and utility classes
- Customizable animations with configurable transition duration and easing
Examples
Button Variants
Use Cases
This free open source React component works well for:
- Call-to-action buttons - Primary actions and form submissions built with Next.js
- Interactive dashboards - Action buttons with visual feedback using TypeScript and Tailwind CSS
- E-commerce interfaces - Add to cart, purchase, and navigation buttons with shadcn/ui
- Gaming interfaces - Interactive buttons that provide satisfying visual feedback for React applications
API Reference
RippleButton
Prop | Type | Default | Description |
---|---|---|---|
children | React.ReactNode | required | Button content to display |
variant | 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'default' | Visual style variant |
size | 'default' | 'sm' | 'lg' | 'icon' | 'default' | Button size variant |
scale | number | 10 | Maximum scale factor for ripple animation |
transition | Transition | { duration: 0.6, ease: 'easeOut' } | Framer Motion transition for ripple effect |
rippleClassName | string | - | Additional CSS classes for ripple elements |
className | string | - | Additional CSS classes for button |
onClick | (event: React.MouseEvent) => void | - | Click handler function |
Button Variants
- default - Primary blue button with white text
- destructive - Red button for destructive actions
- outline - Bordered button with transparent background
- secondary - Muted background with secondary styling
- ghost - Minimal button with hover effects only
Size Variants
- sm - Small button (36px height) with reduced padding
- default - Standard button (40px height) with normal padding
- lg - Large button (44px height) with increased padding
- icon - Square button (40x40px) for icon-only usage
Implementation Notes
- Ripple effects are automatically positioned at click coordinates
- Uses CSS overflow hidden to contain ripple animations within button bounds
- Ripple elements are automatically cleaned up after animation completes
- Compatible with all standard button props and accessibility features
- Built with class-variance-authority for consistent variant management
- Integrates seamlessly with shadcn/ui design system and motion/react
Liquid Button
Animated button with fluid fill effect and multiple variants. Perfect for React applications requiring smooth interactions with Next.js integration and TypeScript support.
Code Block
Advanced syntax highlighting with line numbers and clipboard functionality. Perfect for React documentation requiring code display with Next.js integration and TypeScript support.