← 返回 Skills 市场
wpank

Loading State Patterns

作者 wpank · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
797
总下载
0
收藏
2
当前安装
1
版本数
在 OpenClaw 中安装
/install loading-state-patterns
功能描述
Patterns for skeleton loaders, shimmer effects, and loading states that match design system aesthetics. Covers skeleton components, shimmer animations, and progressive loading. Use when building polished loading experiences. Triggers on skeleton, loading state, shimmer, placeholder, loading animation.
使用说明 (SKILL.md)

Loading State Patterns

Build loading states that feel intentional and match your design system aesthetic.


When to Use

  • Building skeleton loaders for content areas
  • Need shimmer effects for streaming content
  • Want progressive loading experiences
  • Building premium loading UX

Pattern 1: Skeleton Base

import { cn } from '@/lib/utils';

interface SkeletonProps extends React.HTMLAttributes\x3CHTMLDivElement> {
  shimmer?: boolean;
}

export function Skeleton({ className, shimmer = true, ...props }: SkeletonProps) {
  return (
    \x3Cdiv
      className={cn(
        'rounded-md bg-muted',
        shimmer && 'animate-shimmer bg-gradient-to-r from-muted via-muted-foreground/10 to-muted bg-[length:200%_100%]',
        className
      )}
      {...props}
    />
  );
}

CSS Animation

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.animate-shimmer {
  animation: shimmer 1.5s ease-in-out infinite;
}

Pattern 2: Content Skeleton Layouts

Card Skeleton

export function CardSkeleton() {
  return (
    \x3Cdiv className="rounded-lg border bg-card p-4 space-y-3">
      \x3Cdiv className="flex items-center gap-3">
        \x3CSkeleton className="size-10 rounded-full" />
        \x3Cdiv className="space-y-1.5 flex-1">
          \x3CSkeleton className="h-4 w-1/3" />
          \x3CSkeleton className="h-3 w-1/4" />
        \x3C/div>
      \x3C/div>
      \x3CSkeleton className="h-20 w-full" />
      \x3Cdiv className="flex gap-2">
        \x3CSkeleton className="h-8 w-20" />
        \x3CSkeleton className="h-8 w-20" />
      \x3C/div>
    \x3C/div>
  );
}

Table Row Skeleton

export function TableRowSkeleton({ columns = 4 }: { columns?: number }) {
  return (
    \x3Ctr>
      {Array.from({ length: columns }).map((_, i) => (
        \x3Ctd key={i} className="p-3">
          \x3CSkeleton className="h-4 w-full" />
        \x3C/td>
      ))}
    \x3C/tr>
  );
}

Metric Skeleton

export function MetricSkeleton() {
  return (
    \x3Cdiv className="space-y-2">
      \x3CSkeleton className="h-3 w-16" />
      \x3CSkeleton className="h-8 w-24" />
    \x3C/div>
  );
}

Pattern 3: Design System Skeleton

Match skeleton to your aesthetic:

// For retro-futuristic theme
export function CyberSkeleton({ className, ...props }: SkeletonProps) {
  return (
    \x3Cdiv
      className={cn(
        'rounded-md bg-tone-cadet/30',
        'animate-pulse-glow',
        'border border-tone-cyan/10',
        className
      )}
      {...props}
    />
  );
}

// CSS
@keyframes pulse-glow {
  0%, 100% { opacity: 0.4; box-shadow: 0 0 0 0 rgba(var(--tone-cyan), 0); }
  50% { opacity: 0.6; box-shadow: 0 0 8px 0 rgba(var(--tone-cyan), 0.1); }
}

Pattern 4: Progressive Loading

Show content as it loads:

interface ProgressiveLoadProps {
  isLoading: boolean;
  skeleton: React.ReactNode;
  children: React.ReactNode;
}

export function ProgressiveLoad({
  isLoading,
  skeleton,
  children,
}: ProgressiveLoadProps) {
  return (
    \x3Cdiv className="relative">
      {isLoading ? (
        skeleton
      ) : (
        \x3Cmotion.div
          initial={{ opacity: 0 }}
          animate={{ opacity: 1 }}
          transition={{ duration: 0.2 }}
        >
          {children}
        \x3C/motion.div>
      )}
    \x3C/div>
  );
}

Pattern 5: Streaming Content Indicator

For AI/LLM content that streams:

export function StreamingIndicator() {
  return (
    \x3Cdiv className="flex items-center gap-1">
      {[0, 1, 2].map((i) => (
        \x3Cmotion.div
          key={i}
          className="size-1.5 rounded-full bg-primary"
          animate={{ scale: [1, 1.3, 1], opacity: [0.5, 1, 0.5] }}
          transition={{
            duration: 0.8,
            repeat: Infinity,
            delay: i * 0.15,
          }}
        />
      ))}
    \x3C/div>
  );
}

Pattern 6: Loading Progress Bar

interface LoadingProgressProps {
  progress?: number; // 0-100, undefined = indeterminate
}

export function LoadingProgress({ progress }: LoadingProgressProps) {
  const isIndeterminate = progress === undefined;

  return (
    \x3Cdiv className="h-1 w-full bg-muted overflow-hidden rounded-full">
      \x3Cdiv
        className={cn(
          'h-full bg-primary transition-all duration-300',
          isIndeterminate && 'animate-indeterminate'
        )}
        style={!isIndeterminate ? { width: `${progress}%` } : undefined}
      />
    \x3C/div>
  );
}

// CSS
@keyframes indeterminate {
  0% { transform: translateX(-100%); width: 50%; }
  100% { transform: translateX(200%); width: 50%; }
}

.animate-indeterminate {
  animation: indeterminate 1.5s ease-in-out infinite;
}

Pattern 7: Skeleton Grid

export function GridSkeleton({ 
  count = 6, 
  columns = 3 
}: { 
  count?: number; 
  columns?: number;
}) {
  return (
    \x3Cdiv 
      className="grid gap-4" 
      style={{ gridTemplateColumns: `repeat(${columns}, 1fr)` }}
    >
      {Array.from({ length: count }).map((_, i) => (
        \x3CCardSkeleton key={i} />
      ))}
    \x3C/div>
  );
}

Related Skills


NEVER Do

  • Use gray skeletons on dark themes — Match your surface colors
  • Skip shimmer animation — Static blocks look broken
  • Make skeletons exact size — Slight size variation is natural
  • Forget aspect ratios — Images need consistent skeleton ratios
  • Show skeleton forever — Add timeout fallbacks for errors

Quick Reference

// Basic skeleton
\x3CSkeleton className="h-4 w-full" />

// Avatar skeleton
\x3CSkeleton className="size-10 rounded-full" />

// Text lines
\x3Cdiv className="space-y-2">
  \x3CSkeleton className="h-4 w-3/4" />
  \x3CSkeleton className="h-4 w-1/2" />
\x3C/div>

// Card skeleton
\x3Cdiv className="p-4 space-y-3">
  \x3CSkeleton className="h-6 w-1/3" />
  \x3CSkeleton className="h-20 w-full" />
\x3C/div>
安全使用建议
This skill is an instruction-only collection of React/CSS examples for loading states and appears internally consistent. Before installing or copying code: (1) review the snippets to ensure they fit your coding standards and licenses, (2) be cautious with the README's manual install suggestions — they reference local paths (~/.ai-skills) and a GitHub tree URL that may not be directly installable with npx, so verify the source repository and trustworthiness, and (3) because the skill’s source/homepage is 'unknown', confirm the origin if you intend to include these patterns in production. No credentials or system access are requested by this skill.
功能分析
Type: OpenClaw Skill Name: loading-state-patterns Version: 1.0.0 The skill bundle provides UI components and CSS for various loading state patterns. All code examples are client-side React/TypeScript and CSS, without any system calls, network requests, or sensitive data handling. The `SKILL.md` contains no prompt injection attempts, and the `README.md`'s installation instructions, including an `npx add` command fetching from GitHub, are standard for skill distribution and do not indicate malicious intent, as they refer to the skill itself. There is no evidence of data exfiltration, malicious execution, persistence, or obfuscation.
能力评估
Purpose & Capability
The name and description match the content: SKILL.md contains only UI patterns, example components, and CSS for skeletons/shimmers. It does not request unrelated credentials, binaries, or configuration.
Instruction Scope
Runtime instructions are example code snippets and guidance for building loading states. The SKILL.md does not instruct the agent to read system files, environment variables, or contact external endpoints; it stays within the stated design-pattern scope.
Install Mechanism
There is no install spec and no code files beyond documentation. README contains optional manual install copy instructions (local filesystem paths) and an npx example, but nothing will be automatically downloaded or executed by the platform.
Credentials
The skill declares no required environment variables, credentials, or config paths. The SKILL.md does not reference any secrets or external service tokens.
Persistence & Privilege
always is false and the skill does not request persistent or elevated privileges. It does not modify other skills or system settings in its instructions.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install loading-state-patterns
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /loading-state-patterns 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of loading-state-patterns skill. - Provides reusable patterns for skeleton loaders, shimmer effects, progressive loading, and polished loading states. - Includes code examples for skeleton base, cards, tables, metrics, and grid layouts. - Supports design-system themed skeletons and streaming/loading indicators. - Offers best practices and "never do" guidelines for consistent UX. - Quick reference section for common skeleton usage patterns.
元数据
Slug loading-state-patterns
版本 1.0.0
许可证
累计安装 2
当前安装数 2
历史版本数 1
常见问题

Loading State Patterns 是什么?

Patterns for skeleton loaders, shimmer effects, and loading states that match design system aesthetics. Covers skeleton components, shimmer animations, and progressive loading. Use when building polished loading experiences. Triggers on skeleton, loading state, shimmer, placeholder, loading animation. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 797 次。

如何安装 Loading State Patterns?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install loading-state-patterns」即可一键安装,无需额外配置。

Loading State Patterns 是免费的吗?

是的,Loading State Patterns 完全免费(开源免费),可自由下载、安装和使用。

Loading State Patterns 支持哪些平台?

Loading State Patterns 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Loading State Patterns?

由 wpank(@wpank)开发并维护,当前版本 v1.0.0。

💬 留言讨论