Ripple Button
animate-ui/components-buttons-rippleFreeComponent
A button that animates on tap with a ripple effect.
Install it
npx shadcn@latest add https://animate-ui.com/r/components-buttons-ripple.jsonSource
1'use client';23import * as React from 'react';4import { type VariantProps } from 'class-variance-authority';56import { buttonVariants } from '@/components/animate-ui/components/buttons/button';7import {8 RippleButton as RippleButtonPrimitive,9 RippleButtonRipples as RippleButtonRipplesPrimitive,10 type RippleButtonProps as RippleButtonPrimitiveProps,11 type RippleButtonRipplesProps as RippleButtonRipplesPrimitiveProps,12} from '@/components/animate-ui/primitives/buttons/ripple';13import { cn } from '@/lib/utils';1415const rippleButtonVariants = {16 default: '[--ripple-button-ripple-color:var(--primary-foreground)]',17 accent: '[--ripple-button-ripple-color:var(--accent-foreground)]',18 destructive: '[--ripple-button-ripple-color:var(--destructive-foreground)]',19 outline: '[--ripple-button-ripple-color:var(--foreground)]',20 secondary: '[--ripple-button-ripple-color:var(--secondary-foreground)]',21 ghost: '[--ripple-button-ripple-color:var(--foreground)]',22 link: '[--ripple-button-ripple-color:var(--primary-foreground)]',23};2425type RippleButtonProps = RippleButtonPrimitiveProps &26 VariantProps<typeof buttonVariants>;2728function RippleButton({29 className,30 variant,31 size,32 ...props33}: RippleButtonProps) {34 return (35 <RippleButtonPrimitive36 className={cn(37 buttonVariants({ variant, size, className }),38 rippleButtonVariants[variant as keyof typeof rippleButtonVariants],39 )}40 {...props}41 />42 );43}4445type RippleButtonRipplesProps = RippleButtonRipplesPrimitiveProps;4647function RippleButtonRipples(props: RippleButtonRipplesProps) {48 return <RippleButtonRipplesPrimitive {...props} />;49}5051export {52 RippleButton,53 RippleButtonRipples,54 type RippleButtonProps,55 type RippleButtonRipplesProps,56};
What it pulls in
npm packages
Other registry items
Files it writes
More from Animate UI
All 580 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Avatar Groupcomponents-animate-avatar-group | Animate UI | Components | Free | 1 dep | |
| Codecomponents-animate-code | Animate UI | Components | Free | 1 dep | |
| Code Tabscomponents-animate-code-tabs | Animate UI | Components | Free | 1 dep | |
| Cursorcomponents-animate-cursor | Animate UI | Components | Free | no deps | |
| GitHub Stars Wheelcomponents-animate-github-stars-wheel | Animate UI | Components | Free | 1 dep | |
| Tabscomponents-animate-tabs | Animate UI | Components | Free | no deps | |
| Tooltipcomponents-animate-tooltip | Animate UI | Components | Free | 1 dep | |
| Bubble Backgroundcomponents-backgrounds-bubble | Animate UI | Components | Free | 1 dep |
