aceternity-ui by secondsky/claude-skills
npx skills add https://github.com/secondsky/claude-skills --skill aceternity-uiAceternity UI 是一个专为 Next.js 应用程序设计的高级、可用于生产环境的 React 组件库。它提供了 100 多个使用 Tailwind CSS 和 Framer Motion 构建的、具有精美动画和交互效果的组件。组件通过 shadcn CLI 安装,并可直接在您的代码库中进行自定义。
主要特性:
先决条件:
对于新项目:
# 创建 Next.js 项目(推荐 bun)
bunx create-next-app@latest my-app
# 或:npx create-next-app@latest my-app
# 或:pnpm create next-app@latest my-app
cd my-app
# 选择以下选项:
# - TypeScript:是
# - ESLint:是
# - Tailwind CSS:是
# - src/ 目录:可选
# - App Router:是(推荐)
# - 导入别名:@/*(默认)
通过 shadcn CLI 初始化 Aceternity UI:
# 使用 bun(推荐)
bunx --bun shadcn@latest init
# 使用 npm
npx shadcn@latest init
# 使用 pnpm
pnpm dlx shadcn@latest init
# 在设置过程中:
# - 样式:New York(推荐)
# - 颜色:Zinc(或您的偏好)
# - CSS 变量:是(推荐)
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
配置注册表:
初始化后,更新 components.json 以添加 Aceternity 注册表:
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "app/globals.css",
"baseColor": "zinc",
"cssVariables": true
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
},
"registries": {
"@aceternity": "https://ui.aceternity.com/registry/{name}.json"
}
}
使用 shadcn CLI 3.0+(命名空间注册表):
# 安装特定组件
bunx shadcn@latest add @aceternity/background-beams
# 或:npx shadcn@latest add @aceternity/background-beams
# 或:pnpm dlx shadcn@latest add @aceternity/background-beams
# 组件将被添加到:components/ui/background-beams.tsx
手动安装:
如果注册表方法不起作用,请手动安装:
bun add motion clsx tailwind-merge
# 或:npm install motion clsx tailwind-merge
2. 将工具函数添加到 lib/utils.ts:
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
3. 从 ui.aceternity.com 复制组件代码到您的项目
为主图区域和全页面布局创建令人惊叹的动画背景和视觉效果。
关键组件:
使用示例:
"use client";
import { BackgroundBeams } from "@/components/ui/background-beams";
export default function HeroSection() {
return (
<div className="h-screen w-full relative">
<div className="max-w-4xl mx-auto z-10 relative p-8">
<h1 className="text-5xl font-bold">欢迎</h1>
<p className="text-xl mt-4">精美的动画背景</p>
</div>
<BackgroundBeams />
</div>
);
}
何时使用:
具有悬停效果、动画和 3D 变换的交互式卡片。
关键组件:
使用示例:
"use client";
import { CardBody, CardContainer, CardItem } from "@/components/ui/3d-card";
export function ProductCard() {
return (
<CardContainer>
<CardBody className="bg-gray-50 rounded-xl p-6">
<CardItem translateZ="50" className="text-2xl font-bold">
产品标题
</CardItem>
<CardItem translateZ="60" as="p" className="text-sm mt-2">
产品描述在这里
</CardItem>
<CardItem translateZ="100" className="w-full mt-4">
<img src="/product.jpg" className="rounded-xl" alt="Product" />
</CardItem>
</CardBody>
</CardContainer>
);
}
何时使用:
创建引人入胜的基于滚动的动画和视差效果。
关键组件:
使用示例:
import { StickyScroll } from "@/components/ui/sticky-scroll-reveal";
const content = [
{
title: "功能一",
description: "功能一的描述...",
content: <div>视觉内容在这里</div>
},
// 更多项目...
];
export function Features() {
return <StickyScroll content={content} />;
}
何时使用:
用于标题、标题和交互式排版的动画文本效果。
关键组件:
使用示例:
import { TypewriterEffect } from "@/components/ui/typewriter-effect";
const words = [
{ text: "构建" },
{ text: "令人惊叹的" },
{ text: "网站", className: "text-blue-500" }
];
export function Hero() {
return <TypewriterEffect words={words} />;
}
何时使用:
具有动画和效果的增强型按钮组件。
关键组件:
使用示例:
import { MovingBorder } from "@/components/ui/moving-border";
export function CTAButton() {
return (
<MovingBorder duration={2000} className="p-4">
<span>开始使用</span>
</MovingBorder>
);
}
现代导航菜单和标签系统。
关键组件:
增强的表单输入和文件上传组件。
关键组件:
使用示例:
import { PlaceholdersAndVanishInput } from "@/components/ui/placeholders-and-vanish-input";
export function SearchBar() {
const placeholders = [
"搜索任何内容...",
"您要找什么?",
"输入以搜索..."
];
return (
<PlaceholdersAndVanishInput
placeholders={placeholders}
onChange={(e) => console.log(e.target.value)}
onSubmit={(e) => {
e.preventDefault();
console.log("已提交");
}}
/>
);
}
带有动画的模态对话框和工具提示。
关键组件:
使用示例:
import { Modal, ModalBody, ModalContent, ModalTrigger } from "@/components/ui/animated-modal";
export function BookingModal() {
return (
<Modal>
<ModalTrigger className="bg-black text-white px-4 py-2 rounded-md">
立即预订
</ModalTrigger>
<ModalBody>
<ModalContent>
<h2>预订详情</h2>
{/* 模态框内容 */}
</ModalContent>
</ModalBody>
</Modal>
);
}
图像滑块和轮播组件。
关键组件:
网格布局和容器组件。
关键组件:
用于显示数据和比较的组件。
关键组件:
跟随光标的效果和交互。
关键组件:
使用 CSS 变换的 3D 视觉效果。
关键组件:
加载动画和进度指示器。
关键组件:
预构建的部分模板。
关键组件:
所有 Aceternity 组件都通过 Tailwind 的深色模式类支持深色模式:
<div className="bg-white dark:bg-black text-black dark:text-white">
{/* 内容 */}
</div>
组件默认是响应式的。使用 Tailwind 的响应式前缀:
<h1 className="text-2xl md:text-4xl lg:text-6xl">
响应式标题
</h1>
可以组合组件以创建复杂布局:
import { BackgroundBeams } from "@/components/ui/background-beams";
import { TypewriterEffect } from "@/components/ui/typewriter-effect";
import { MovingBorder } from "@/components/ui/moving-border";
export default function Hero() {
return (
<div className="h-screen relative">
<div className="z-10 relative flex flex-col items-center justify-center h-full">
<TypewriterEffect words={words} />
<MovingBorder>
<button>开始使用</button>
</MovingBorder>
</div>
<BackgroundBeams />
</div>
);
}
使用 "use client" 指令 - Aceternity 组件使用 Framer Motion,需要客户端渲染:
"use client";
import { Component } from "@/components/ui/component";
懒加载重量级组件:
import dynamic from 'next/dynamic';
const HeavyBackground = dynamic(
() => import('@/components/ui/background-beams'),
{ ssr: false }
);
添加 ARIA 标签:
<button aria-label="打开菜单">
<MenuIcon />
</button>
确保键盘导航:
<div role="button" tabIndex={0} onKeyDown={handleKeyDown}>
交互式元素
</div>
使用 className 覆盖样式:
<BackgroundBeams className="opacity-50" />
直接修改组件源代码 - 由于组件已复制到您的项目中,您可以编辑它们:
// components/ui/background-beams.tsx
export function BackgroundBeams({ className, myCustomProp }: Props) {
// 根据需要自定义
}
使用 TypeScript 定义属性类型:
interface CardProps {
title: string;
description: string;
image?: string;
}
export function Card({ title, description, image }: CardProps) {
// 组件实现
}
1. "找不到模块:motion"
bun add motion
# 或:npm install motion
2. "cn 未定义" 确保 lib/utils.ts 存在并包含 cn 辅助函数。
3. 组件没有动画 验证文件顶部是否有 "use client" 指令。
4. Tailwind 类不起作用 确保 Tailwind 已配置且 globals.css 导入了 Tailwind 指令:
@tailwind base;
@tailwind components;
@tailwind utilities;
5. 深色模式不起作用 检查 tailwind.config.ts 是否配置了 darkMode: "class"。
此技能通过以下方式显著节省令牌:
预计节省:每次实施约 10k 令牌(减少 65-70%)
防止的错误:
根据任务上下文加载参考文件:
| 如果用户询问... | 加载此参考文件 |
|---|---|
| 新项目设置、安装、入门指南 | references/quick-start.md(465 行) |
| 查找特定组件、组件类别、CLI 命令 | references/component-catalog.md(635 行) |
| 使用示例、模式、故障排除 | 主 SKILL.md(本文件) |
参考摘要:
quick-start.md - 5 分钟设置指南,首个组件示例,故障排除,项目结构component-catalog.md - 100 多个组件的完整列表,包含安装命令和用例使用此技能时,请考虑结合:
nextjs - Next.js 框架技能tailwind-v4-shadcn - Tailwind CSS v4 配置react-hook-form-zod - 表单验证clerk-auth - 身份验证cloudflare-nextjs - Cloudflare 部署此技能文档根据 MIT 许可证提供。Aceternity UI 组件有其自己的许可证 - 请访问 https://ui.aceternity.com 查看详情。
最后更新 : 2025-12-08 版本 : 1.1.0 维护者 : Claude Skills Maintainers
每周安装数
406
仓库
GitHub 星标数
90
首次出现
Jan 23, 2026
安全审计
安装于
opencode372
gemini-cli367
codex350
cursor340
github-copilot329
claude-code314
Aceternity UI is a premium, production-ready React component library designed for Next.js applications. It provides 100+ beautifully animated and interactive components built with Tailwind CSS and Framer Motion. Components are installed via the shadcn CLI and can be customized directly in your codebase.
Key Features:
Prerequisites:
For New Projects:
# Create Next.js project (bun preferred)
bunx create-next-app@latest my-app
# or: npx create-next-app@latest my-app
# or: pnpm create next-app@latest my-app
cd my-app
# Select these options:
# - TypeScript: Yes
# - ESLint: Yes
# - Tailwind CSS: Yes
# - src/ directory: Optional
# - App Router: Yes (recommended)
# - Import alias: @/* (default)
Initialize Aceternity UI via shadcn CLI:
# Using bun (preferred)
bunx --bun shadcn@latest init
# Using npm
npx shadcn@latest init
# Using pnpm
pnpm dlx shadcn@latest init
# During setup:
# - Style: New York (recommended)
# - Color: Zinc (or your preference)
# - CSS variables: Yes (recommended)
Configure Registry:
After initialization, update components.json to add Aceternity registry:
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "app/globals.css",
"baseColor": "zinc",
"cssVariables": true
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
},
"registries": {
"@aceternity": "https://ui.aceternity.com/registry/{name}.json"
}
}
Using shadcn CLI 3.0+ (Namespaced Registry):
# Install specific component
bunx shadcn@latest add @aceternity/background-beams
# or: npx shadcn@latest add @aceternity/background-beams
# or: pnpm dlx shadcn@latest add @aceternity/background-beams
# Component will be added to: components/ui/background-beams.tsx
Manual Installation:
If the registry method doesn't work, install manually:
bun add motion clsx tailwind-merge
# or: npm install motion clsx tailwind-merge
2. Add utility function to lib/utils.ts:
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
3. Copy component code from ui.aceternity.com to your project
Create stunning animated backgrounds and visual effects for hero sections and full-page layouts.
Key Components:
Usage Example:
"use client";
import { BackgroundBeams } from "@/components/ui/background-beams";
export default function HeroSection() {
return (
<div className="h-screen w-full relative">
<div className="max-w-4xl mx-auto z-10 relative p-8">
<h1 className="text-5xl font-bold">Welcome</h1>
<p className="text-xl mt-4">Beautiful animated backgrounds</p>
</div>
<BackgroundBeams />
</div>
);
}
When to Use:
Interactive cards with hover effects, animations, and 3D transformations.
Key Components:
Usage Example:
"use client";
import { CardBody, CardContainer, CardItem } from "@/components/ui/3d-card";
export function ProductCard() {
return (
<CardContainer>
<CardBody className="bg-gray-50 rounded-xl p-6">
<CardItem translateZ="50" className="text-2xl font-bold">
Product Title
</CardItem>
<CardItem translateZ="60" as="p" className="text-sm mt-2">
Product description goes here
</CardItem>
<CardItem translateZ="100" className="w-full mt-4">
<img src="/product.jpg" className="rounded-xl" alt="Product" />
</CardItem>
</CardBody>
</CardContainer>
);
}
When to Use:
Create engaging scroll-based animations and parallax effects.
Key Components:
Usage Example:
import { StickyScroll } from "@/components/ui/sticky-scroll-reveal";
const content = [
{
title: "Feature One",
description: "Description of feature one...",
content: <div>Visual content here</div>
},
// More items...
];
export function Features() {
return <StickyScroll content={content} />;
}
When to Use:
Animated text effects for headings, titles, and interactive typography.
Key Components:
Usage Example:
import { TypewriterEffect } from "@/components/ui/typewriter-effect";
const words = [
{ text: "Build" },
{ text: "amazing" },
{ text: "websites", className: "text-blue-500" }
];
export function Hero() {
return <TypewriterEffect words={words} />;
}
When to Use:
Enhanced button components with animations and effects.
Key Components:
Usage Example:
import { MovingBorder } from "@/components/ui/moving-border";
export function CTAButton() {
return (
<MovingBorder duration={2000} className="p-4">
<span>Get Started</span>
</MovingBorder>
);
}
Modern navigation menus and tab systems.
Key Components:
Enhanced form inputs and file upload components.
Key Components:
Usage Example:
import { PlaceholdersAndVanishInput } from "@/components/ui/placeholders-and-vanish-input";
export function SearchBar() {
const placeholders = [
"Search for anything...",
"What are you looking for?",
"Type to search..."
];
return (
<PlaceholdersAndVanishInput
placeholders={placeholders}
onChange={(e) => console.log(e.target.value)}
onSubmit={(e) => {
e.preventDefault();
console.log("submitted");
}}
/>
);
}
Modal dialogs and tooltips with animations.
Key Components:
Usage Example:
import { Modal, ModalBody, ModalContent, ModalTrigger } from "@/components/ui/animated-modal";
export function BookingModal() {
return (
<Modal>
<ModalTrigger className="bg-black text-white px-4 py-2 rounded-md">
Book Now
</ModalTrigger>
<ModalBody>
<ModalContent>
<h2>Booking Details</h2>
{/* Modal content */}
</ModalContent>
</ModalBody>
</Modal>
);
}
Image sliders and carousel components.
Key Components:
Grid layouts and container components.
Key Components:
Components for displaying data and comparisons.
Key Components:
Cursor-following effects and interactions.
Key Components:
3D visual effects using CSS transforms.
Key Components:
Loading animations and progress indicators.
Key Components:
Pre-built section templates.
Key Components:
All Aceternity components support dark mode via Tailwind's dark mode classes:
<div className="bg-white dark:bg-black text-black dark:text-white">
{/* Content */}
</div>
Components are responsive by default. Use Tailwind's responsive prefixes:
<h1 className="text-2xl md:text-4xl lg:text-6xl">
Responsive Heading
</h1>
Components can be combined for complex layouts:
import { BackgroundBeams } from "@/components/ui/background-beams";
import { TypewriterEffect } from "@/components/ui/typewriter-effect";
import { MovingBorder } from "@/components/ui/moving-border";
export default function Hero() {
return (
<div className="h-screen relative">
<div className="z-10 relative flex flex-col items-center justify-center h-full">
<TypewriterEffect words={words} />
<MovingBorder>
<button>Get Started</button>
</MovingBorder>
</div>
<BackgroundBeams />
</div>
);
}
Use "use client" directive - Aceternity components use Framer Motion, requiring client-side rendering:
"use client";
import { Component } from "@/components/ui/component";
Lazy load heavy components:
import dynamic from 'next/dynamic';
const HeavyBackground = dynamic(
() => import('@/components/ui/background-beams'),
{ ssr: false }
);
Add ARIA labels:
<button aria-label="Open menu">
<MenuIcon />
</button>
Ensure keyboard navigation:
<div role="button" tabIndex={0} onKeyDown={handleKeyDown}>
Interactive element
</div>
Override styles using className:
<BackgroundBeams className="opacity-50" />
Modify component source directly - Since components are copied to your project, you can edit them:
// components/ui/background-beams.tsx
export function BackgroundBeams({ className, myCustomProp }: Props) {
// Customize as needed
}
Use TypeScript for prop types:
interface CardProps {
title: string;
description: string;
image?: string;
}
export function Card({ title, description, image }: CardProps) {
// Component implementation
}
1. "Module not found: motion"
bun add motion
# or: npm install motion
2. "cn is not defined" Ensure lib/utils.ts exists with the cn helper function.
3. Components not animating Verify "use client" directive is at the top of the file.
4. Tailwind classes not working Ensure Tailwind is configured and globals.css imports Tailwind directives:
@tailwind base;
@tailwind components;
@tailwind utilities;
5. Dark mode not working Check tailwind.config.ts has darkMode: "class" configured.
This skill provides significant token savings by:
Estimated savings: ~10k tokens (65-70% reduction) per implementation
Errors prevented:
Load reference files based on task context:
| If User Asks About... | Load This Reference |
|---|---|
| New project setup, installation, getting started | references/quick-start.md (465 lines) |
| Finding specific components, component categories, CLI commands | references/component-catalog.md (635 lines) |
| Usage examples, patterns, troubleshooting | Main SKILL.md (this file) |
Reference Summary:
quick-start.md - 5-minute setup guide, first component examples, troubleshooting, project structurecomponent-catalog.md - Complete list of 100+ components with install commands and use casesWhen using this skill, consider combining with:
nextjs - Next.js framework skilltailwind-v4-shadcn - Tailwind CSS v4 configurationreact-hook-form-zod - Form validationclerk-auth - Authenticationcloudflare-nextjs - Cloudflare deploymentThis skill documentation is provided under MIT License. Aceternity UI components have their own licensing - check https://ui.aceternity.com for details.
Last Updated : 2025-12-08 Version : 1.1.0 Maintainer : Claude Skills Maintainers
Weekly Installs
406
Repository
GitHub Stars
90
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykPass
Installed on
opencode372
gemini-cli367
codex350
cursor340
github-copilot329
claude-code314
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
105,000 周安装
Bilibili 字幕提取工具 - 支持 AI 字幕检测与 ASR 转录,一键下载视频字幕
715 周安装
CTF密码学挑战速查指南 | 经典/现代密码攻击、RSA/ECC/流密码实战技巧
895 周安装
Pencil Design Skill:AI辅助UI设计工具,从设计到代码生成最佳实践
731 周安装
assistant-ui thread-list 线程列表:管理多聊天线程的 React AI SDK 组件
705 周安装
ralphinho-rfc-pipeline:AI驱动的复杂功能分解与多单元编排工作流工具
850 周安装
Chrome Bridge 自动化:Midscene 真实浏览器自动化工具,保留登录状态
657 周安装