Join the Discord!
Buttons

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.

Loading component...

Installation

npx shadcn@latest add https://www.shadcn.io/registry/liquid-button.json
npx shadcn@latest add https://www.shadcn.io/registry/liquid-button.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/liquid-button.json
bunx shadcn@latest add https://www.shadcn.io/registry/liquid-button.json

Features

  • Liquid fill animation with smooth gradient transitions and customizable timing using CSS variables
  • Multiple variants including default, outline, and secondary styles with theme-aware colors
  • Size variants supporting small, default, large, and icon-only button configurations
  • Motion integration with scale animations for hover and tap interactions using Motion
  • TypeScript support with complete interface definitions and variant props
  • shadcn/ui compatibility using design tokens and className merging utilities

Use Cases

This free open source React component works well for:

  • Primary actions - Call-to-action buttons with engaging liquid fill effects in Next.js applications
  • Interactive forms - Submit buttons that provide satisfying visual feedback using TypeScript and Tailwind CSS
  • Navigation elements - Menu items with smooth hover states for modern web interfaces
  • Creative portfolios - Artistic button designs that showcase advanced CSS animations

API Reference

LiquidButton

PropTypeDefaultDescription
variant"default" | "outline" | "secondary""default"Visual style variant with different color schemes
size"default" | "sm" | "lg" | "icon""default"Button size configuration affecting padding and height
classNamestring-Additional CSS classes for custom styling
childrenReact.ReactNode-Button content (text, icons, or other elements)

Variants

  • default - Primary color fill with muted background
  • outline - Border style with transparent background
  • secondary - Secondary color scheme for less prominent actions

Sizes

  • sm - Small button (36px height) for compact interfaces
  • default - Standard button (40px height) for general use
  • lg - Large button (48px height) for prominent actions
  • icon - Square button (40px) for icon-only content

Implementation Notes

  • Uses CSS custom properties for liquid fill animation timing
  • Background gradient animates from 0% to 100% width on hover
  • Scale animations provide tactile feedback during interactions
  • Compatible with all standard button HTML attributes
  • Supports keyboard navigation and focus states
  • Credits to Emadamerho Nefe for the original inspiration