Join the Discord!
Buttons

Icon Button

Animated icon button with hover effects, customizable colors, and particle animations. Perfect for React applications requiring interactive button elements with Next.js integration and TypeScript support.

Loading component...

Installation

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

Features

  • Multiple sizes with responsive icon scaling (sm, default, md, lg)
  • Customizable colors using RGB array values for dynamic theming
  • Smooth animations with scale effects on hover and tap using Framer Motion
  • Active state effects including radial gradient pulses, glow animations, and particle burst
  • TypeScript support with complete interface definitions and type safety
  • shadcn/ui integration using design tokens and utility functions
  • Accessible design with proper ARIA attributes and semantic button structure

Use Cases

This free open source React component works well for:

  • Interactive interfaces - Like buttons, favorite toggles, and action controls built with Next.js
  • Dashboard applications - Icon-based navigation and controls using TypeScript and Tailwind CSS
  • Media applications - Play/pause, like/unlike, and bookmark functionality with shadcn/ui
  • Social features - Star ratings, hearts, and reaction buttons for React applications

API Reference

IconButton

PropTypeDefaultDescription
iconReact.ElementTyperequiredLucide React icon component to display
activebooleanfalseControls active state and animations
animatebooleantrueEnables particle and glow animations when active
size'sm' | 'default' | 'md' | 'lg''default'Button size variant with responsive icon scaling
color[number, number, number][59, 130, 246]RGB color array for theming and animations
transitionTransition{ type: 'spring', stiffness: 300, damping: 15 }Framer Motion transition configuration
classNamestring-Additional CSS classes for customization

Size Variants

  • sm - Small button (24px) with 16px icon
  • default - Standard button (32px) with 20px icon
  • md - Medium button (40px) with 24px icon
  • lg - Large button (48px) with 28px icon

Implementation Notes

  • Requires Framer Motion for animations and interactions
  • Uses CSS custom properties for dynamic color theming
  • Active state triggers particle burst and glow effects
  • Compatible with all Lucide React icons
  • Built on motion/react for optimal performance
  • Integrates seamlessly with shadcn/ui design system