refactor-21st-ui

Refactors raw 21st.dev TSX components into Next.js App Router and shadcn/ui workspace standards.

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/marketiv-id/marketiv-web --skill refactor-21st-ui-marketiv-id
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: refactor-21st-ui
Source: https://github.com/marketiv-id/marketiv-web/tree/main/.github/skills/refactor-21st-ui
Command: npx skills add https://github.com/marketiv-id/marketiv-web --skill refactor-21st-ui-marketiv-id

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Raw components copied from 21st.dev often violate project conventions: missing client boundaries, inconsistent icon libraries, redundant class-merge utilities, and Framer Motion scroll animations that conflict with a GSAP + Lenis animation stack. This Skill normalizes those components into copy-paste-ready code that follows the workspace rules. ## Core Features & Use Cases - Client Boundary Enforcement: Adds "use client" at the top of the file and validates no imports precede it. - Import Normalization: Converts class-merge helpers to cn from @/lib/utils and maps external icons to the nearest lucide-react equivalent. - Hybrid Animation Policy: Keeps Framer Motion only for micro-interactions (hover, tap, modals) and replaces scroll-driven patterns like useScroll and whileInView with a // TODO: Replace with GSAP ScrollTrigger via useGSAP() marker. - Use Case: You paste a raw 21st.dev hero section using whileInView reveals and Radix icons, and receive a cleaned TSX component with lucide icons, Tailwind-aligned styles, and GSAP migration TODOs plus a summary of changes. ## Quick Start Paste the raw 21st.dev TSX component code and ask to refactor it into this workspace's standards with the target filename.

Frequently Asked Questions about refactor-21st-ui

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor a 21st.dev component for Next.js App Router?▼

Paste the raw TSX code and the refactor adds a "use client" directive at the top, normalizes imports to project aliases like @/lib/utils, and outputs a full copy-paste-ready code block with a summary of changes.

When should I use Framer Motion vs GSAP for React animations?▼

Use Framer Motion only for micro-interactions such as hover, tap, and modal transitions. Use GSAP with ScrollTrigger and Lenis for macro animations like scroll progress, parallax, and in-view section reveals.

Can I keep whileInView animations from Framer Motion?▼

No. Under this policy, whileInView is treated as a macro scroll animation and must be removed. The refactor inserts a TODO comment marking where GSAP ScrollTrigger via useGSAP() should replace it.

How are non-lucide icons handled during refactoring?▼

External icon libraries such as Radix Icons are replaced with the semantically nearest lucide-react icon. If no close equivalent exists, a neutral generic icon is used and the mapping assumption is noted in the change summary.

What happens to inline styles in the refactored component?▼

Static inline styles are converted to Tailwind utility classes. Inline styles are kept only for genuinely runtime-dynamic values, and mixed static-plus-dynamic styles are split accordingly.