share-08

share-08 is an animated share icon that draws three nodes linked by two wires, and pulses the nodes as the connection lights up on hover. It is a forwardRef component that wraps a motion-driven SVG in a div, and it exposes imperative start and stop methods through its ref.

share-08
LIVE · running in a sandboxed iframe
Installed with plain shadcn add · no workarounds · theme neutral (none shipped)
See how it was built

Installation

pnpm dlx shadcn@latest add @hugeicons-animated/share-08

Requires @hugeicons-animated in the registries of your components.json (shadcn adds official directory namespaces automatically).

Usage

usage.tsx
import { Share08Icon } from '@/components/ui/share-08';export function ShareButton() {  return (    <button type='button' aria-label='Share'>      <Share08Icon size={24} />    </button>  );}
  • Share, send, or distribute actions where a network or connection metaphor fits, such as a share button in a toolbar or card.
  • Hover-triggered micro-interactions on icon buttons that should feel lively without looping.
  • Places that need an icon that can be started programmatically from a parent, for example when a share action completes.
  • Projects that already use motion and want a single-shot, reduced-motion-aware icon animation with no extra setup beyond the shared use-icon-animation hook.

Examples

Basic hover animation

Renders the icon at its default size. The animation plays on mouse enter and resets on mouse leave, with no ref needed.

basic-hover-animation.tsx
import { Share08Icon } from '@/components/ui/share-08';export default function Example() {  return <Share08Icon />;}

Programmatic control via ref

Attaching a ref switches the icon to controlled mode, so hovering no longer auto-plays and the parent calls startAnimation and stopAnimation instead.

programmatic-control-via-ref.tsx
import { useRef } from 'react';import { Share08Icon, type Share08IconHandle } from '@/components/ui/share-08';export default function Example() {  const iconRef = useRef<Share08IconHandle>(null);  return (    <div>      <Share08Icon ref={iconRef} size={32} />      <button type='button' onClick={() => iconRef.current?.startAnimation()}>        Play      </button>    </div>  );}

Share button with custom hover handler and class

Passes extra mouse handlers and a Tailwind class. Custom handlers run before the built-in animation trigger.

share-button-with-custom-hover-handler-and-class.tsx
import { Share08Icon } from '@/components/ui/share-08';export default function Example() {  return (    <button      type='button'      aria-label='Share this page'      className='inline-flex items-center gap-2 rounded-md px-3 py-2 text-sm hover:bg-muted'    >      <Share08Icon        size={20}        className='text-primary'        onMouseEnter={() => console.log('share hover')}      />      Share    </button>  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels.
classNamestring—Class name applied to the outer wrapper div, passed through cn().
onMouseEnterMouseEventHandler<HTMLDivElement>—Called before the built-in hover animation starts on the wrapper div.
onMouseLeaveMouseEventHandler<HTMLDivElement>—Called before the built-in leave handling runs on the wrapper div. Stops the animation only when loops is enabled, which it is not here.
refRef<Share08IconHandle>—Exposes startAnimation() and stopAnimation(). Providing a ref disables automatic hover-driven playback, so the parent controls the animation. stopAnimation has no effect because the icon does not loop.
...propsHTMLAttributes<HTMLDivElement>—All other standard div attributes (id, style, aria-*, data-*, and so on) are spread onto the wrapper div.

Accessibility

  • The SVG has no title or role, so give the interactive parent a label such as aria-label='Share' when the icon is the only content.
  • Motion respects prefers-reduced-motion through useReducedMotion, so no animation plays for users who opt out.
  • The wrapper is a div with mouse handlers only. For keyboard access, place the icon inside a button or link and trigger startAnimation from onFocus or a key handler through the ref.
  • Color comes from currentColor, so the icon keeps the text color contrast of its container. Verify the contrast of the parent color scheme.

Docs written by anthropic:claude-haiku-5-5 from the registry source.

Use with Coding Agent

Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.

prompt.md
Use the "share-08" component (hugeicons-animated/share-08) from its shadcn registry.1. Install it with: npx shadcn@latest add @hugeicons-animated/share-082. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: size, className, onMouseEnter, onMouseLeave, ref, ...props.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { Share08Icon } from '@/components/ui/share-08';export function ShareButton() {  return (    <button type='button' aria-label='Share'>      <Share08Icon size={24} />    </button>  );}```

Files & dependencies

  • icons/share-08.tsx
  • lib/use-icon-animation.ts
dependenciesmotion

Looks similar, elsewhere