inspira-ui

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Inspira UI - Animated Vue/Nuxt Component Library

Inspira UI - Vue/Nuxt动画组件库

Inspira UI is a collection of 120+ reusable, animated components powered by TailwindCSS v4, motion-v, GSAP, and Three.js — crafted to help ship beautiful Vue and Nuxt applications faster.
Inspira UI是一个包含120+个可复用动画组件的集合,基于TailwindCSS v4、motion-v、GSAP和Three.js构建——旨在帮助你更快地打造美观的Vue和Nuxt应用。

Table of Contents

目录

When to Use This Skill

适用场景

Use Inspira UI when building:
  • Animated landing pages with hero sections, testimonials, and effects
  • Modern web applications requiring 3D visualizations and interactive elements
  • Marketing sites with eye-catching backgrounds and text animations
  • Portfolio sites with image galleries, carousels, and showcase effects
  • Interactive experiences with custom cursors, special effects, and particle systems
  • Vue 3 or Nuxt 4 projects requiring production-ready animated components
Key Benefits:
  • 120+ copy-paste components (not a traditional npm library)
  • Full TypeScript support with Vue 3 Composition API
  • TailwindCSS v4 with OkLch color space
  • Responsive and mobile-optimized
  • Free and open source (MIT license)
在构建以下项目时可使用Inspira UI:
  • 带动画的着陆页:包含英雄区、客户评价及各类效果
  • 现代Web应用:需要3D可视化和交互式元素
  • 营销网站:具备吸睛背景和文字动画
  • 作品集网站:包含图片画廊、轮播图和展示效果
  • 交互式体验:自定义光标、特殊效果和粒子系统
  • Vue 3或Nuxt 4项目:需要生产就绪的动画组件
核心优势:
  • 120+个可直接复制粘贴的组件(非传统npm库)
  • 全面支持TypeScript和Vue 3 Composition API
  • 采用OkLch色彩空间的TailwindCSS v4
  • 响应式设计,适配移动端
  • 免费开源(MIT许可证)

Quick Start

快速开始

1. Install Core Dependencies

1. 安装核心依赖

bash
undefined
bash
undefined

Required for all components

Required for all components

bun add -d clsx tailwind-merge class-variance-authority tw-animate-css bun add @vueuse/core motion-v
bun add -d clsx tailwind-merge class-variance-authority tw-animate-css bun add @vueuse/core motion-v

Optional: For 3D components (Globe, Cosmic Portal, etc.)

Optional: For 3D components (Globe, Cosmic Portal, etc.)

bun add three @types/three
bun add three @types/three

Optional: For WebGL components (Fluid Cursor, Neural Background, etc.)

Optional: For WebGL components (Fluid Cursor, Neural Background, etc.)

bun add ogl
undefined
bun add ogl
undefined

2. Setup CN Utility

2. 配置CN工具函数

Create
lib/utils.ts
:
typescript
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs));
}
创建
lib/utils.ts
:
typescript
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs));
}

3. Configure CSS Variables

3. 配置CSS变量

Add to your
main.css
. See references/SETUP.md for complete CSS configuration with OkLch colors.
将相关内容添加到你的
main.css
中。完整的CSS配置(包含OkLch颜色)请查看references/SETUP.md

4. Verify Setup

4. 验证安装配置

bash
./scripts/verify-setup.sh
bash
./scripts/verify-setup.sh

5. Copy Components

5. 复制组件

Browse inspira-ui.com/components, copy what you need into
components/ui/
.
浏览inspira-ui.com/components,将所需组件复制到
components/ui/
目录下。

Component Selection Workflow

组件选择流程

What type of effect do you need?
  1. Background Effects → Aurora, Cosmic Portal, Particles, Neural Background
    • See: references/components-list.md#backgrounds
  2. Text Animations → Morphing Text, Glitch, Hyper Text, Sparkles Text
    • See: references/components-list.md#text-animations
  3. 3D Visualizations → Globe, 3D Carousel, Icon Cloud, World Map
    • Dependencies:
      bun add three @types/three
    • See: references/components-list.md#visualization
  4. Interactive Cursors → Fluid Cursor, Tailed Cursor, Smooth Cursor
    • Dependencies:
      bun add ogl
      (for WebGL cursors)
    • See: references/components-list.md#cursors
  5. Animated Buttons → Shimmer, Ripple, Rainbow, Gradient
    • No extra dependencies
    • See: references/components-list.md#buttons
  6. Special Effects → Confetti, Meteors, Neon Border, Glow Border
    • See: references/components-list.md#special-effects
For complete implementation details (props, full code, installation): Fetch https://inspira-ui.com/docs/llms-full.txt - LLM-optimized documentation with structured props tables and working code examples.
你需要哪种类型的效果?
  1. 背景效果 → Aurora、Cosmic Portal、Particles、Neural Background
    • 查看:references/components-list.md#backgrounds
  2. 文字动画 → Morphing Text、Glitch、Hyper Text、Sparkles Text
    • 查看:references/components-list.md#text-animations
  3. 3D可视化 → Globe、3D Carousel、Icon Cloud、World Map
    • 依赖:
      bun add three @types/three
    • 查看:references/components-list.md#visualization
  4. 交互式光标 → Fluid Cursor、Tailed Cursor、Smooth Cursor
    • 依赖:
      bun add ogl
      (适用于WebGL光标)
    • 查看:references/components-list.md#cursors
  5. 动画按钮 → Shimmer、Ripple、Rainbow、Gradient
    • 无需额外依赖
    • 查看:references/components-list.md#buttons
  6. 特殊效果 → Confetti、Meteors、Neon Border、Glow Border
    • 查看:references/components-list.md#special-effects
完整实现细节(属性、完整代码、安装说明): 访问https://inspira-ui.com/docs/llms-full.txt - 针对LLM优化的文档,包含结构化属性表和可运行代码示例。

Core Usage Patterns

核心使用模式

Pattern 1: Animated Landing Page

模式1:动画着陆页

vue
<template>
  <AuroraBackground>
    <Motion
      :initial="{ opacity: 0, y: 40, filter: 'blur(10px)' }"
      :while-in-view="{ opacity: 1, y: 0, filter: 'blur(0px)' }"
      :transition="{ delay: 0.3, duration: 0.8, ease: 'easeInOut' }"
      class="relative flex flex-col items-center gap-4 px-4"
    >
      <div class="text-center text-3xl font-bold md:text-7xl">
        Your amazing headline
      </div>
      <ShimmerButton>Get Started</ShimmerButton>
    </Motion>
  </AuroraBackground>
</template>

<script setup lang="ts">
import { Motion } from "motion-v";
import AuroraBackground from "~/components/ui/AuroraBackground.vue";
import ShimmerButton from "~/components/ui/ShimmerButton.vue";
</script>
vue
<template>
  <AuroraBackground>
    <Motion
      :initial="{ opacity: 0, y: 40, filter: 'blur(10px)' }"
      :while-in-view="{ opacity: 1, y: 0, filter: 'blur(0px)' }"
      :transition="{ delay: 0.3, duration: 0.8, ease: 'easeInOut' }"
      class="relative flex flex-col items-center gap-4 px-4"
    >
      <div class="text-center text-3xl font-bold md:text-7xl">
        Your amazing headline
      </div>
      <ShimmerButton>Get Started</ShimmerButton>
    </Motion>
  </AuroraBackground>
</template>

<script setup lang="ts">
import { Motion } from "motion-v";
import AuroraBackground from "~/components/ui/AuroraBackground.vue";
import ShimmerButton from "~/components/ui/ShimmerButton.vue";
</script>

Pattern 2: Props with TypeScript Interfaces

模式2:使用TypeScript接口定义属性

vue
<script setup lang="ts">
// ALWAYS use interface-based props
interface Props {
  title: string;
  count?: number;
  variant?: "primary" | "secondary";
}

const props = withDefaults(defineProps<Props>(), {
  count: 0,
  variant: "primary",
});
</script>
vue
<script setup lang="ts">
// ALWAYS use interface-based props
interface Props {
  title: string;
  count?: number;
  variant?: "primary" | "secondary";
}

const props = withDefaults(defineProps<Props>(), {
  count: 0,
  variant: "primary",
});
</script>

Pattern 3: Explicit Imports (Critical for Vue.js Compatibility)

模式3:显式导入(对Vue.js兼容性至关重要)

vue
<script setup lang="ts">
// ALWAYS include explicit imports even with Nuxt auto-imports
import { ref, onMounted, computed } from "vue";
import { useWindowSize } from "@vueuse/core";

const { width } = useWindowSize();
</script>
vue
<script setup lang="ts">
// ALWAYS include explicit imports even with Nuxt auto-imports
import { ref, onMounted, computed } from "vue";
import { useWindowSize } from "@vueuse/core";

const { width } = useWindowSize();
</script>

Pattern 4: WebGL Component Cleanup

模式4:WebGL组件资源清理

vue
<script setup lang="ts">
import { onUnmounted } from "vue";

let animationFrame: number;
let renderer: any;

onUnmounted(() => {
  // CRITICAL: Clean up WebGL resources to prevent memory leaks
  if (animationFrame) cancelAnimationFrame(animationFrame);
  if (renderer) renderer.dispose();
});
</script>
vue
<script setup lang="ts">
import { onUnmounted } from "vue";

let animationFrame: number;
let renderer: any;

onUnmounted(() => {
  // CRITICAL: Clean up WebGL resources to prevent memory leaks
  if (animationFrame) cancelAnimationFrame(animationFrame);
  if (renderer) renderer.dispose();
});
</script>

Pattern 5: Client-Only Wrapper (Nuxt)

模式5:仅客户端包装器(Nuxt)

vue
<template>
  <ClientOnly>
    <FluidCursor />
  </ClientOnly>
</template>
vue
<template>
  <ClientOnly>
    <FluidCursor />
  </ClientOnly>
</template>

Critical Pitfalls to Avoid

需避免的关键陷阱

1. Accessibility Bug (CRITICAL)

1. 无障碍访问漏洞(严重)

The original Inspira UI docs have
--destructive-foreground
set to the same color as
--destructive
, making text invisible. Use the corrected value:
css
:root {
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.985 0 0); /* CORRECTED */
}
原始Inspira UI文档中
--destructive-foreground
的颜色与
--destructive
相同,导致文本不可见。请使用以下修正值:
css
:root {
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.985 0 0); /* CORRECTED */
}

2. Missing CSS Imports

2. 缺失CSS导入

css
/* REQUIRED in main.css */
@import "tailwindcss";
@import "tw-animate-css";  /* Often forgotten! */
css
/* REQUIRED in main.css */
@import "tailwindcss";
@import "tw-animate-css";  /* Often forgotten! */

3. Wrong Props Syntax

3. 属性语法错误

typescript
// DON'T: Object syntax
const props = defineProps({ title: { type: String } });

// DO: Interface syntax
interface Props { title: string; }
const props = defineProps<Props>();
typescript
// DON'T: Object syntax
const props = defineProps({ title: { type: String } });

// DO: Interface syntax
interface Props { title: string; }
const props = defineProps<Props>();

4. Three.js Without ClientOnly (Nuxt)

4. Three.js组件未使用ClientOnly(Nuxt)

vue
<!-- WRONG: Will fail during SSR -->
<GithubGlobe :markers="markers" />

<!-- CORRECT -->
<ClientOnly>
  <GithubGlobe :markers="markers" />
</ClientOnly>
vue
<!-- WRONG: Will fail during SSR -->
<GithubGlobe :markers="markers" />

<!-- CORRECT -->
<ClientOnly>
  <GithubGlobe :markers="markers" />
</ClientOnly>

5. Using Enums Instead of
as const

5. 使用枚举而非
as const

typescript
// DON'T: TypeScript enums
enum ButtonVariant { Primary = "primary" }

// DO: as const objects
const ButtonVariants = { Primary: "primary" } as const;
typescript
// DON'T: TypeScript enums
enum ButtonVariant { Primary = "primary" }

// DO: as const objects
const ButtonVariants = { Primary: "primary" } as const;

Token Efficiency

令牌效率

Average Token Savings: ~65%
  • Without skill: ~15k tokens (trial-and-error with setup)
  • With skill: ~5k tokens (direct implementation)
Errors Prevented: 13+ common issues including:
  1. Critical accessibility bug (destructive-foreground)
  2. TailwindCSS v4 CSS variables misconfiguration
  3. Missing
    @import "tw-animate-css"
  4. Motion-V setup issues
  5. Three.js/OGL without ClientOnly
  6. Props typed with object syntax instead of interfaces
  7. Missing explicit imports
平均令牌节省率:约65%
  • 未使用本指南:约15000令牌(需反复尝试配置)
  • 使用本指南:约5000令牌(直接实现)
避免的错误:13+种常见问题,包括:
  1. 严重的无障碍访问漏洞(destructive-foreground)
  2. TailwindCSS v4 CSS变量配置错误
  3. 缺失
    @import "tw-animate-css"
  4. Motion-V配置问题
  5. Three.js/OGL组件未使用ClientOnly
  6. 使用对象语法而非接口定义属性
  7. 缺失显式导入

Detailed Documentation

详细参考文档

For complete setup with all CSS variables: references/SETUP.md
For all 120+ components with dependencies: references/components-list.md
For troubleshooting common issues: references/TROUBLESHOOTING.md
For TypeScript patterns and conventions: references/CODE_PATTERNS.md
完整CSS变量配置references/SETUP.md
120+组件及依赖列表references/components-list.md
常见问题排查references/TROUBLESHOOTING.md
TypeScript模式与规范references/CODE_PATTERNS.md

Keywords

关键词

Frameworks: Vue, Vue 3, Nuxt, Nuxt 4, Composition API, script setup
Styling: TailwindCSS v4, OkLch, CSS variables, dark mode
Animation: motion-v, GSAP, Three.js, WebGL, OGL, canvas
Components: aurora background, shimmer button, morphing text, 3D globe, fluid cursor, confetti, neon border, icon cloud, flip card, particles
Use Cases: landing pages, hero sections, animated backgrounds, interactive UI, marketing sites, portfolios, 3D websites
Problems Solved: Vue animations, Nuxt animations, animated components, 3D effects, particle effects, modern UI effects
框架:Vue、Vue 3、Nuxt、Nuxt 4、Composition API、script setup
样式:TailwindCSS v4、OkLch、CSS变量、暗色模式
动画:motion-v、GSAP、Three.js、WebGL、OGL、canvas
组件:aurora背景、shimmer按钮、变形文字、3D地球、流体光标、彩屑效果、霓虹边框、图标云、翻转卡片、粒子效果
适用场景:着陆页、英雄区、动画背景、交互式UI、营销网站、作品集、3D网站
解决的问题:Vue动画、Nuxt动画、动画组件、3D效果、粒子效果、现代UI效果

Resources

资源


Production Status: ✅ Production-Ready Token Efficiency: ✅ ~65% savings Error Prevention: ✅ 13+ common issues prevented Last Updated: 2025-11-12

生产就绪状态:✅ 已就绪 令牌效率:✅ 约65%节省 错误预防:✅ 避免13+种常见问题 最后更新:2025-11-12