Magic Ui

magicuidesign/magicui/skills/magic-ui

作者 magicuidesigncdb348cb4c72a9b54b554d8617801e479fbc8714無授權條款收錄於 2026年10月9日更新於 2026年10月9日

Use this skill when users want to add, customize, or troubleshoot Magic UI components in React/Next.js projects. It covers component selection, shadcn registry installation (`@magicui/*`), integration patterns, and practical quality checks for accessibility and maintainability.

AI 產生的概覽

指導在 React/Next.js 專案中透過 shadcn 登錄檔加入、自訂與排解 Magic UI 元件問題。

功能
此技能說明如何挑選 Magic UI 元件、透過 shadcn 登錄檔的 @magicui 命名空間安裝元件,並整合到頁面區塊中。內容涵蓋 Tailwind CSS 與 shadcn 初始化等前置條件,以及無障礙、響應式、效能與可維護性方面的品質檢查。它也提供登錄檔、匯入路徑、樣式與缺少相依套件等問題的排解步驟,並指向兩份隨附的參考檔案以了解元件細節與區塊實作模式。
適用情境
當使用者想要加入 marquee、globe、shiny-button 等 Magic UI 元件,建立 hero 或使用者評價等動畫區塊,以元件取代手寫動畫程式碼,或解決 @magicui 套件的安裝與匯入問題時使用。
執行需求
需要一個使用 Tailwind CSS 並已初始化 shadcn 的 React 或 Next.js 專案;透過 shadcn CLI 安裝登錄檔元件。此技能不含指令碼,只有說明文件與兩份參考檔案。

Magic UI

Use this skill when the task involves Magic UI components, animated UI sections, or converting static sections into interactive UI using the Magic UI registry.

When To Apply

Apply this skill when users ask to:

  • Add a Magic UI component (for example: marquee, globe, blur-fade, shiny-button)
  • Build a section with Magic UI effects (hero, testimonials, CTA, feature grid)
  • Replace custom animation code with Magic UI components
  • Troubleshoot installation/import issues for @magicui/*

Core Workflow

  1. Define the UI outcome first.
  • Identify section type, tone, motion intensity, and responsive behavior.
  • Keep motion intentional; avoid stacking many high-motion effects in one viewport.
  1. Confirm project prerequisites.
  • Project should be React/Next.js with Tailwind CSS.
  • shadcn must be initialized before adding registry components:
bash
npx shadcn@latest init
  1. Install the selected component(s).
bash
npx shadcn@latest add @magicui/<component-slug>

Example:

bash
npx shadcn@latest add @magicui/magic-card
  1. Integrate into the target section.
  • Import from the generated path (typically @/components/ui/<component-slug>).
  • Keep component APIs intact; prefer prop/className customization over rewriting internals.
  • If docs mention extra dependencies or CSS keyframes, add them during integration.
  1. Validate quality before finishing.
  • Accessibility: semantic HTML, keyboard access, meaningful labels/text.
  • Responsiveness: check mobile layout and overflow behavior.
  • Performance: avoid unnecessary client-only wrappers and heavy animation stacking.
  • Maintainability: keep new code modular and consistent with existing project conventions.

References To Load On Demand

  • For component choice, install shape, and dependency expectations:
    • Read references/components.md
  • For section-level implementation patterns:
    • Read references/recipes.md

Quick Component Selection Heuristics

  • Social proof/logo rails: marquee, avatar-circles
  • Hero visual impact: globe, warp-background, animated-grid-pattern
  • Text animation: blur-fade, text-animate, word-rotate, sparkles-text
  • CTA emphasis: shiny-button, shimmer-button, rainbow-button
  • Ambient backgrounds: grid-pattern, dot-pattern, particles, flickering-grid

Start with 1 core component + 1 supporting effect, then expand only if needed.

Troubleshooting

  • components.json or registry init error:
    • Run npx shadcn@latest init in the project root.
  • Import path mismatch (@/ alias not configured):
    • Use the project's alias style or relative imports.
  • Visual mismatch after install:
    • Check for required global CSS/keyframes listed in the component docs.
  • Missing package errors:
    • Install dependencies listed in the component's manual installation steps.

Reference Links

  • Magic UI docs: https://magicui.design/docs
  • Component docs: https://magicui.design/docs/components
  • Installation: https://magicui.design/docs/installation
  • MCP setup (optional, for AI IDE workflows): https://magicui.design/docs/mcp

來源與署名

來源:magicuidesign/magicui位於skills/magic-ui提交cdb348c

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架