The Problem

Building polished React micro-interactions—entrance transitions, hover effects, card layouts—usually means hand-rolling animation code or pulling in heavy component libraries that are hard to customize. This repo is a curated collection of Motion-powered primitives that can be dropped into any React project via a CLI or the shadcn registry system.

What This Does

This is a portfolio of four self-contained projects, not a single codebase. The main deliverable is a component registry (registry/) with 163 code files and 164 JSON metadata files, plus a demo application (src/) with 153 code files. The registry follows the shadcn/ui pattern: each component is a standalone .tsx file paired with a .json manifest.

The registry covers entrance transitions (fade-in, fade-up, zoom-in), hover effects (tilt-card, magnetic-button), text animations (text-reveal), and card layout systems (arc, fan, cascade, scatter patterns). It also includes reusable hooks (use-scroll-progress, use-stagger, use-web-haptics) and spring presets (registry/lib/presets.ts).

How It Is Wired

The repo has no single execution path. The demo app (src/App.tsx, 1282 lines) is the entry point, rendering chart and animation pages. The registry is consumed externally: users install components via npx @subhanhq/amicro@latest add <component> or through shadcn's registry mapping.

Static analysis shows 321 internal modules with 299 import edges and no circular dependencies. Two modules carry notable blast radius:

  • src/data/loaders (Ca 2, Ce 128, instability 0.98) — imports 128 modules; almost certainly a barrel file. High churn risk.
  • src/components/dither-charts/lib/recharts-tooltip (Ca 17, Ce 0) — 17 modules depend on this leaf. Keep it stable.

How To Use It

Setup: npm install @subhanhq/amicro

Configuration: Add the registry mapping to components.json:

{
  "registries": {
    "@amicro": "https://raw.githubusercontent.com/Subhan-code/Amicro--Micro-transitions-/main/registry/{name}.json"
  }
}

Running it:

npx @subhanhq/amicro@latest init
npx @subhanhq/amicro@latest add download-button
npx shadcn add @amicro/fade-in

The demo app runs via npm run dev (Vite, per vite.config.ts).

Real-World Use

A marketing site needing consistent entrance animations without a design-system overhaul. Install the registry, then:

import { FadeUp } from "@/components/amicro/fade-up";

export function Hero() {
  return <FadeUp delay={0.2}>Your headline</FadeUp>;
}

Components install as local source, so you can modify them freely.

Code Health & Issues

Static analysis found 32 issues (9 high, 23 medium) across 5 kinds:

  • High - Deep nesting (×21)src/App.tsx, MembersGrowthChart.tsx hit indentation depth 12. Flatten with guard clauses.
  • High - Duplicated code (×122 files) — 3044 repeated 6-line blocks across registry/hooks/ and registry/ui/. Extract shared helpers.
  • High - Oversized files (×6)src/App.tsx (1282 lines), src/utils/codeGenerator.ts, upload.sh. Split by responsibility.
  • Medium - Hub modulerecharts-tooltip.tsx has 17 dependents; keep it small.

SDLC gaps: no test suite (321 source files, zero tests), CI workflow lacks least-privilege token permissions, no Dependabot, no dependency vulnerability scan, and persist-credentials is not disabled on checkout. No secrets committed.

The Bottom Line

A solid, well-organized component library with genuine utility for React developers who want Motion-based micro-interactions without building from scratch. The registry pattern is proven and the component breadth is substantial. The lack of tests and the duplicated code across 122 files are real maintenance risks—the registry is the valuable part, but it needs test coverage before production adoption.