BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/Animate UI/components-buttons-icon

Icon Button

animate-ui/components-buttons-icon
FreeComponent

An icon button component with a variety of styles and animations.

Install it

npx shadcn@latest add https://animate-ui.com/r/components-buttons-icon.json

Source

registry/components/buttons/icon/index.tsxanimate-ui.com/r/components-buttons-icon.json
1'use client';
2
3import * as React from 'react';
4import { cva, type VariantProps } from 'class-variance-authority';
5
6import {
7 Button as ButtonPrimitive,
8 type ButtonProps as ButtonPrimitiveProps,
9} from '@/components/animate-ui/primitives/buttons/button';
10import { cn } from '@/lib/utils';
11import {
12 Particles,
13 ParticlesEffect,
14} from '@/components/animate-ui/primitives/effects/particles';
15
16const buttonVariants = cva(
17 "flex items-center justify-center rounded-md transition-[box-shadow,_color,_background-color,_border-color,_outline-color,_text-decoration-color,_fill,_stroke] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
18 {
19 variants: {
20 variant: {
21 default:
22 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
23 accent: 'bg-accent text-accent-foreground shadow-xs hover:bg-accent/90',
24 destructive:
25 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
26 outline:
27 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
28 secondary:
29 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
30 ghost:
31 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
32 link: 'text-primary underline-offset-4 hover:underline',
33 },
34 size: {
35 default: 'size-9',
36 xs: "size-7 [&_svg:not([class*='size-'])]:size-3.5 rounded-md",
37 sm: 'size-8 rounded-md',
38 lg: 'size-10 rounded-md',
39 },
40 },
41 defaultVariants: {
42 variant: 'default',
43 size: 'default',
44 },
45 },
46);
47
48type IconButtonProps = Omit<ButtonPrimitiveProps, 'asChild'> &
49 VariantProps<typeof buttonVariants> & {
50 children?: React.ReactNode;
51 };
52
53function IconButton({
54 className,
55 onClick,
56 variant,
57 size,
58 children,
59 ...props
60}: IconButtonProps) {
61 const [isActive, setIsActive] = React.useState(false);
62 const [key, setKey] = React.useState(0);
63
64 return (
65 <Particles asChild animate={isActive} key={key}>
66 <ButtonPrimitive
67// … truncated

What it pulls in

npm packages

  • class-variance-authority

Other registry items

  • @animate-ui/primitives-buttons-button
  • @animate-ui/primitives-effects-particles

Files it writes

  • registry/components/buttons/icon/index.tsx

Facts

Registry
Animate UI
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-04
Last confirmed
today

Go to the source

animate-ui.com imskyleen/animate-ui on GitHub Raw registry item This item as JSON

More from Animate UI

All 580 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Avatar Groupcomponents-animate-avatar-groupAnimate UIComponentsFree1 dep
Codecomponents-animate-codeAnimate UIComponentsFree1 dep
Code Tabscomponents-animate-code-tabsAnimate UIComponentsFree1 dep
Cursorcomponents-animate-cursorAnimate UIComponentsFreeno deps
GitHub Stars Wheelcomponents-animate-github-stars-wheelAnimate UIComponentsFree1 dep
Tabscomponents-animate-tabsAnimate UIComponentsFreeno deps
Tooltipcomponents-animate-tooltipAnimate UIComponentsFree1 dep
Bubble Backgroundcomponents-backgrounds-bubbleAnimate UIComponentsFree1 dep
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex