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-community-share-button

Share Button

animate-ui/components-community-share-button
FreeComponent

This is a button for sharing.

Install it

npx shadcn@latest add https://animate-ui.com/r/components-community-share-button.json

Source

registry/components/community/share-button/index.tsxanimate-ui.com/r/components-community-share-button.json
1'use client';
2import * as React from 'react';
3import { Share2, Github, X, Facebook } from 'lucide-react';
4import { cva, type VariantProps } from 'class-variance-authority';
5import { HTMLMotionProps, motion, AnimatePresence } from 'motion/react';
6
7import { cn } from '@/lib/utils';
8
9const buttonVariants = cva(
10 "relative overflow-hidden cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all 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",
11 {
12 variants: {
13 size: {
14 default: 'min-w-28 h-10 px-4 py-2',
15 sm: 'min-w-24 h-9 rounded-md gap-1.5 px-3',
16 md: 'min-w-28 h-10 px-4 py-2',
17 lg: 'min-w-32 h-11 px-8',
18 },
19 icon: {
20 suffix: 'pl-4',
21 prefix: 'pr-4',
22 },
23 },
24 defaultVariants: {
25 size: 'default',
26 },
27 },
28);
29
30const iconSizeMap = {
31 sm: 16,
32 md: 20,
33 lg: 28,
34 default: 16,
35};
36
37type ShareButtonProps = HTMLMotionProps<'button'> & {
38 children: React.ReactNode;
39 className?: string;
40 onIconClick?: (platform: 'github' | 'x' | 'facebook') => void;
41} & VariantProps<typeof buttonVariants>;
42
43function ShareButton({
44 children,
45 className,
46 size,
47 icon,
48 onIconClick,
49 ...props
50}: ShareButtonProps) {
51 const [hovered, setHovered] = React.useState(false);
52 return (
53 <motion.button
54 className={cn(
55 'bg-primary text-primary-foreground hover:bg-primary/90',
56 buttonVariants({ size, className, icon }),
57 )}
58 onMouseEnter={() => setHovered(true)}
59 onMouseLeave={() => setHovered(false)}
60 {...props}
61 >
62 <AnimatePresence initial={false} mode="wait">
63 {!hovered ? (
64 <motion.div
65 key="content"
66 initial={{ opacity: 1, y: 0 }}
67 animate={{ opacity: 1, y: 0 }}
68 exit={{ opacity: 0, y: -24 }}
69 transition={{ duration: 0.3 }}
70 className=" absolute left-0 right-0 top-0 bottom-0 flex items-center justify-center gap-2"
71 >
72 {icon === 'prefix' && (
73 <Share2
74 className="size-4"
75 size={iconSizeMap[size as keyof typeof iconSizeMap]}
76 />
77 )}
78// … truncated

What it pulls in

npm packages

  • motion
  • lucide-react
  • class-variance-authority

Files it writes

  • registry/components/community/share-button/index.tsx

Facts

Registry
Animate UI
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-12
Last confirmed
yesterday

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

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

KitGrade

SaaS starter kits, scored from measured facts

kitgrade.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex