← 返回 Skills 市场
wpank

Animated Financial Display Design System

作者 wpank · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
876
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install animated-financial-display
功能描述
Patterns for animating financial numbers with spring physics, formatting, and visual feedback. Covers animated counters, price tickers, percentage changes, and value flash effects. Use when building financial dashboards or trading UIs. Triggers on animated number, price animation, financial display, number formatting, spring animation, value ticker.
使用说明 (SKILL.md)

Animated Financial Display

Create engaging financial number displays with smooth animations, proper formatting, and visual feedback on value changes.


When to Use

  • Building trading dashboards with live prices
  • Showing portfolio values that update in real-time
  • Displaying metrics that need attention on change
  • Any financial UI that benefits from motion

Pattern 1: Spring-Animated Number

Using framer-motion's spring physics:

import { useSpring, animated } from '@react-spring/web';
import { useEffect, useRef } from 'react';

interface AnimatedNumberProps {
  value: number;
  prefix?: string;
  suffix?: string;
  decimals?: number;
  duration?: number;
}

export function AnimatedNumber({
  value,
  prefix = '',
  suffix = '',
  decimals = 2,
  duration = 500,
}: AnimatedNumberProps) {
  const prevValue = useRef(value);

  const { number } = useSpring({
    from: { number: prevValue.current },
    to: { number: value },
    config: { duration },
  });

  useEffect(() => {
    prevValue.current = value;
  }, [value]);

  return (
    \x3Canimated.span className="tabular-nums">
      {number.to((n) => `${prefix}${n.toFixed(decimals)}${suffix}`)}
    \x3C/animated.span>
  );
}

Usage

\x3CAnimatedNumber value={price} prefix="$" decimals={2} />
\x3CAnimatedNumber value={percentage} suffix="%" decimals={1} />

Pattern 2: Value with Flash Effect

Flash color on value change:

import { useEffect, useState, useRef } from 'react';
import { cn } from '@/lib/utils';

interface FlashingValueProps {
  value: number;
  formatter: (value: number) => string;
}

export function FlashingValue({ value, formatter }: FlashingValueProps) {
  const [flash, setFlash] = useState\x3C'up' | 'down' | null>(null);
  const prevValue = useRef(value);

  useEffect(() => {
    if (value !== prevValue.current) {
      setFlash(value > prevValue.current ? 'up' : 'down');
      prevValue.current = value;
      
      const timer = setTimeout(() => setFlash(null), 600);
      return () => clearTimeout(timer);
    }
  }, [value]);

  return (
    \x3Cspan
      className={cn(
        'transition-colors duration-600',
        flash === 'up' && 'text-success',
        flash === 'down' && 'text-destructive'
      )}
    >
      {formatter(value)}
    \x3C/span>
  );
}

Pattern 3: Financial Number Formatting

// lib/formatters.ts
export function formatCurrency(
  value: number,
  options: {
    currency?: string;
    compact?: boolean;
    decimals?: number;
  } = {}
): string {
  const { currency = 'USD', compact = false, decimals = 2 } = options;

  if (compact && Math.abs(value) >= 1_000_000_000) {
    return `$${(value / 1_000_000_000).toFixed(1)}B`;
  }
  if (compact && Math.abs(value) >= 1_000_000) {
    return `$${(value / 1_000_000).toFixed(1)}M`;
  }
  if (compact && Math.abs(value) >= 1_000) {
    return `$${(value / 1_000).toFixed(1)}K`;
  }

  return new Intl.NumberFormat('en-US', {
    style: 'currency',
    currency,
    minimumFractionDigits: decimals,
    maximumFractionDigits: decimals,
  }).format(value);
}

export function formatPercentage(
  value: number,
  options: { showSign?: boolean; decimals?: number } = {}
): string {
  const { showSign = true, decimals = 2 } = options;
  const sign = showSign && value > 0 ? '+' : '';
  return `${sign}${value.toFixed(decimals)}%`;
}

export function formatNumber(
  value: number,
  options: { compact?: boolean; decimals?: number } = {}
): string {
  const { compact = false, decimals = 0 } = options;

  if (compact) {
    return Intl.NumberFormat('en-US', {
      notation: 'compact',
      maximumFractionDigits: 1,
    }).format(value);
  }

  return new Intl.NumberFormat('en-US', {
    minimumFractionDigits: decimals,
    maximumFractionDigits: decimals,
  }).format(value);
}

Pattern 4: Price Ticker Component

interface PriceTickerProps {
  symbol: string;
  price: number;
  change24h: number;
  changePercent24h: number;
}

export function PriceTicker({
  symbol,
  price,
  change24h,
  changePercent24h,
}: PriceTickerProps) {
  const isPositive = changePercent24h >= 0;

  return (
    \x3Cdiv className="flex items-center justify-between p-3 rounded-lg bg-muted/50">
      \x3Cdiv className="flex items-center gap-2">
        \x3Cspan className="font-display font-medium">{symbol}\x3C/span>
      \x3C/div>
      
      \x3Cdiv className="flex items-center gap-3">
        \x3CAnimatedNumber value={price} prefix="$" decimals={2} />
        
        \x3Cspan
          className={cn(
            'text-sm font-mono tabular-nums',
            isPositive ? 'text-success' : 'text-destructive'
          )}
        >
          {formatPercentage(changePercent24h)}
        \x3C/span>
      \x3C/div>
    \x3C/div>
  );
}

Pattern 5: Metric Card with Animation

interface MetricCardProps {
  label: string;
  value: number;
  previousValue?: number;
  format: 'currency' | 'percent' | 'number';
}

export function MetricCard({
  label,
  value,
  previousValue,
  format,
}: MetricCardProps) {
  const formatValue = (v: number) => {
    switch (format) {
      case 'currency': return formatCurrency(v, { compact: true });
      case 'percent': return formatPercentage(v);
      case 'number': return formatNumber(v, { compact: true });
    }
  };

  const change = previousValue ? ((value - previousValue) / previousValue) * 100 : null;

  return (
    \x3CSurface layer="metric" className="p-4">
      \x3Cdiv className="text-xs uppercase tracking-wider text-muted-foreground mb-1">
        {label}
      \x3C/div>
      
      \x3Cdiv className="text-2xl font-bold font-mono tabular-nums">
        \x3CFlashingValue value={value} formatter={formatValue} />
      \x3C/div>
      
      {change !== null && (
        \x3Cdiv className={cn(
          'text-xs font-mono mt-1',
          change >= 0 ? 'text-success' : 'text-destructive'
        )}>
          {formatPercentage(change)} from previous
        \x3C/div>
      )}
    \x3C/Surface>
  );
}

Pattern 6: CSS Value Flash Animation

@keyframes value-flash-up {
  0% { 
    color: hsl(var(--success));
    text-shadow: 0 0 8px hsl(var(--success) / 0.5);
  }
  100% { 
    color: inherit;
    text-shadow: none;
  }
}

@keyframes value-flash-down {
  0% { 
    color: hsl(var(--destructive));
    text-shadow: 0 0 8px hsl(var(--destructive) / 0.5);
  }
  100% { 
    color: inherit;
    text-shadow: none;
  }
}

.animate-flash-up {
  animation: value-flash-up 0.6s ease-out;
}

.animate-flash-down {
  animation: value-flash-down 0.6s ease-out;
}

Related Skills


NEVER Do

  • Skip tabular-nums — Numbers will jump as they change
  • Use linear animations — Spring/ease-out feels more natural
  • Animate decimals rapidly — Too much motion is distracting
  • Forget compact formatting — Large numbers need abbreviation
  • Show raw floats — Always format with appropriate precision
  • Flash on every render — Only flash on actual value changes

Typography for Numbers

.metric {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.price-large {
  font-size: 2rem;
  font-weight: 800;
}

.percentage {
  font-size: 0.875rem;
  font-weight: 500;
}
安全使用建议
This skill is an instruction-only set of UI patterns (React/TypeScript) and appears internally consistent with its description. Before using: (1) Do not run unfamiliar npx/git commands from unknown repos — prefer to inspect the remote repository first. (2) Copy snippets into your own codebase and review imports such as '@/lib/utils', Surface, and any CSS classes to ensure they exist and are safe. (3) Confirm any runtime dependencies you add (react-spring, framer-motion, Intl) are the versions you expect. (4) Because the skill source is unknown, manually review the full README/skill files from the original repo before trusting or automating any installation.
功能分析
Type: OpenClaw Skill Name: animated-financial-display Version: 1.0.0 The skill bundle provides React/TypeScript/CSS code for animating and formatting financial numbers in UI components. The `SKILL.md` contains only instructional content for UI patterns and does not exhibit any prompt injection attempts against the agent. The `README.md` includes installation instructions, which are either local file copy operations or an `npx add` command pointing to a GitHub directory, neither of which presents clear evidence of malicious execution or intent. There are no indicators of data exfiltration, persistence mechanisms, or obfuscation.
能力评估
Purpose & Capability
The name and description (animated counters, price tickers, percentage changes, flash effects) match the actual content: React components, formatters, and CSS patterns for financial UIs. Nothing requested or shown appears unrelated to the stated purpose.
Instruction Scope
SKILL.md consists of UI component code snippets and formatting helpers only. It does not instruct the agent to read system files, access environment variables, or transmit data to external endpoints. The snippets do reference local app utilities (e.g., cn, Surface) which are normal for component libraries.
Install Mechanism
There is no formal install spec (instruction-only) which minimizes risk. The README includes an example 'npx add https://github.com/.../tree/...' which is non-standard and could suggest fetching remote code; however, that is a README suggestion and not an automated install instruction in the skill metadata. Treat any npx/git fetch from unknown repos cautiously.
Credentials
The skill declares no required environment variables, credentials, or config paths and the instructions do not reference any secrets—this is proportionate for a UI pattern library.
Persistence & Privilege
always is false and the skill is user-invocable only. There is no request for elevated or persistent privileges and no self-modifying install behavior present in the metadata.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install animated-financial-display
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /animated-financial-display 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of animated-financial-display. - Introduces patterns for animating financial numbers with spring physics, formatting, and visual feedback. - Provides ready-to-use components: AnimatedNumber, FlashingValue, PriceTicker, and MetricCard. - Includes utility functions for formatting currency, percentages, and compact numbers. - Demonstrates CSS for value flash animations on price changes. - Offers guidance on best practices and common pitfalls for animated financial displays in dashboards and trading UIs.
元数据
Slug animated-financial-display
版本 1.0.0
许可证
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Animated Financial Display Design System 是什么?

Patterns for animating financial numbers with spring physics, formatting, and visual feedback. Covers animated counters, price tickers, percentage changes, and value flash effects. Use when building financial dashboards or trading UIs. Triggers on animated number, price animation, financial display, number formatting, spring animation, value ticker. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 876 次。

如何安装 Animated Financial Display Design System?

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

Animated Financial Display Design System 是免费的吗?

是的,Animated Financial Display Design System 完全免费(开源免费),可自由下载、安装和使用。

Animated Financial Display Design System 支持哪些平台?

Animated Financial Display Design System 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Animated Financial Display Design System?

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

💬 留言讨论