Bold

BoldIcon is an animated bold-style icon for React that thickens the stroke of a stroke-based SVG path on hover using Motion. It exposes an imperative ref handle so parents can trigger the animation programmatically.

Bold
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 https://lucide-animated.com/r/bold.json

Usage

usage.tsx
import { BoldIcon } from "@/components/ui/bold";export default function Example() {  return <BoldIcon />;}
  • Adding a hover-reactive bold/emphasis icon to toolbars, text formatting menus, or navigation items
  • Signaling emphasis or a selected state for a text-formatting control that should visibly thicken on interaction
  • Driving the stroke-weight animation from outside the component via the ref handle (for example, when a parent button is focused or a timer fires)
  • Decorative micro-interactions in landing pages or marketing UI where a lightweight stroke animation adds polish

Examples

Basic hover icon

Renders the icon at its default 28px size; the stroke animates on mouse enter and returns on mouse leave.

basic-hover-icon.tsx
import { BoldIcon } from "@/components/ui/bold";export default function BasicExample() {  return (    <div className="flex items-center gap-2 text-foreground">      <BoldIcon />      <span>Bold text</span>    </div>  );}

Controlled via ref in a toolbar button

Uses forwardRef to call startAnimation and stopAnimation from a parent, for example when the button is toggled active. Note that once the ref is attached, the component suppresses its own hover animation and relies on the handle.

controlled-via-ref-in-a-toolbar-button.tsx
import { useRef } from "react";import type { BoldIconHandle } from "@/components/ui/bold";import { BoldIcon } from "@/components/ui/bold";export default function ToolbarBold() {  const iconRef = useRef<BoldIconHandle>(null);  return (    <button      type="button"      className="rounded-md p-2 hover:bg-accent"      onFocus={() => iconRef.current?.startAnimation()}      onBlur={() => iconRef.current?.stopAnimation()}      aria-label="Bold"    >      <BoldIcon ref={iconRef} size={20} />    </button>  );}

Larger icon with custom styling

Sets a bigger size and applies Tailwind color classes through className on the wrapper div.

larger-icon-with-custom-styling.tsx
import { BoldIcon } from "@/components/ui/bold";export default function LargeBold() {  return (    <BoldIcon      size={48}      className="text-blue-600 cursor-pointer"    />  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels.
classNamestring—Class name applied to the outer wrapper div.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Mouse enter handler on the wrapper div. Called instead of the built-in animation once the ref handle has been attached.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Mouse leave handler on the wrapper div. Called instead of the built-in animation once the ref handle has been attached.
refReact.Ref<BoldIconHandle>—Forwarded ref exposing startAnimation() and stopAnimation() to animate the stroke programmatically.
...propsHTMLAttributes<HTMLDivElement>—All other standard div attributes are spread onto the wrapper div, such as id, style, aria-*, and event handlers.

Accessibility

  • The SVG has no title or role; when the icon conveys meaning on its own, pass aria-label or aria-hidden via the wrapper div props, and wrap it in a button with an accessible name.
  • Decorative use alongside visible text should set aria-hidden="true" on the wrapper to avoid redundant announcements.
  • The animation is a stroke-weight change only and does not move content, so it is generally safe, but consider respecting prefers-reduced-motion by avoiding automatic triggering through the ref in that case.
  • Icon color comes from currentColor, so keep sufficient contrast against the background in both light and dark themes.

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 "Bold" component (lucide-animated/bold) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/bold.json2. 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 { BoldIcon } from "@/components/ui/bold";export default function Example() {  return <BoldIcon />;}```

Files & dependencies

  • bold.tsx
dependenciesmotion

Looks similar, elsewhere