본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)7.2k · #13446

liquid-metal-border

하는 일

이 스킬은 metal-fx 패키지를 써서 React 요소 주위에 금속성의 움직이는 WebGL 테두리를 추가하도록 AI 에이전트를 안내합니다. 선택되거나 활성화된 컨트롤에 프리미엄 강조를 원하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓버튼, 카드, 탭이 선택되거나 활성화되었을 때 금속 테두리가 필요할 때.
  • ✓프리미엄이나 호버 상태에 액체 금속 가장자리가 필요할 때.
  • ✓React 프로젝트에서 금속 테두리를 조정하거나 고쳐야 하는 경우.

스킬 링크

https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/liquid-metal-border/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/liquid-metal-border/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“React 앱의 선택된 가격 카드에 액체 금속 테두리를 추가해 주세요. 대체용으로 일반 테두리를 남겨 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 실제 상호작용 요소 하나를 금속 컴포넌트로 감싸고, 그 애니메이션을 활성 또는 선택 상태에 연결합니다. 정적인 테두리가 대체 화면으로 남으며, 비활성 항목은 자원을 아끼기 위해 멈춥니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Liquid Metal Border

Core Contract

  1. Use metal-fx in React 18 or newer.
  2. Wrap exactly one real host element such as a button, a, div, or article.
  3. Keep the host semantic and interactive. MetalFx is visual framing, not the control.
  4. Reserve the animated border for active, selected, focused, hovered, or primary surfaces. Do not put it around every control.
  5. Keep a static CSS border or focus outline as the fallback. WebGL decoration must never carry essential state by itself.
  6. Pause non-active instances and reduced-motion experiences.
  7. Test light and dark modes independently. Reflections intentionally render only in dark mode.

Inspect Before Editing

  • Confirm the project uses React and has react and react-dom version 18 or newer.
  • Find the real control, its dimensions, radius, background, border, outline, shadow, active-state source, and theme source.
  • Decide whether the metal should be always visible or driven by active, selected, hover, or focus state.
  • Check whether the project has a manual theme toggle. Use that state instead of theme="auto" when it does not follow the OS.
  • Identify nearby elements that genuinely benefit from reflected light. Do not add reflections by default.
  • Check the installed metal-fx version before relying on the prop surface below.

Install and Import

Install with the project's package manager:

npm install metal-fx
# pnpm add metal-fx
# yarn add metal-fx
# bun add metal-fx

Import the named React component:

import { MetalFx } from "metal-fx";

Do not import a stylesheet. The package injects its component styles. It supports ESM and CommonJS builds, is SSR-safe, and mounts the WebGL pipeline after hydration. In a Next.js App Router project, render it from a Client Component because the component uses client-side React hooks.

Baseline Button

Start with a restrained border before adding reflections or custom shader geometry:

import { MetalFx } from "metal-fx";

export function UpgradeButton() {
  return (
    <MetalFx
      variant="button"
      preset="chromatic"
      theme="auto"
      strength={0.85}
    >
      <button type="button">Upgrade to Pro</button>
    </MetalFx>
  );
}

The wrapper measures the child, paints the metal ring on top, and keeps the child interactive. Size the child normally with CSS, Tailwind, or inline styles.

Active-State Pattern

Keep one mounted instance and drive its intensity from real component state. Use aria-pressed, aria-selected, or the native selected-state mechanism so the visual effect is not the only signal.

"use client";

import { useEffect, useState } from "react";
import { MetalFx } from "metal-fx";

function useReducedMotion() {
  const [reduced, setReduced] = useState(false);

  useEffect(() => {
    const query = window.matchMedia("(prefers-reduced-motion: reduce)");
    const sync = () => setReduced(query.matches);

    sync();
    query.addEventListener("change", sync);
    return () => query.removeEventListener("change", sync);
  }, []);

  return reduced;
}

export function LiquidMetalToggle({
  selected,
  onSelect,
}: {
  selected: boolean;
  onSelect: () => void;
}) {
  const [hovered, setHovered] = useState(false);
  const [focused, setFocused] = useState(false);
  const reducedMotion = useReducedMotion();
  const highlighted = selected || hovered || focused;

  return (
    <MetalFx
      className="liquid-metal-toggle"
      variant="button"
      preset="chromatic"
      strength={highlighted ? 0.9 : 0.14}
      paused={reducedMotion || !highlighted}
      disableGlow={reducedMotion || !highlighted}
      ringCssPx={selected ? 1.5 : 1}
      normalizeHostStyles={false}
    >
      <button
        type="button"
        className="liquid-metal-toggle__control"
        aria-pressed={selected}
        onClick={onSelect}
        onPointerEnter={() => setHovered(true)}
        onPointerLeave={() => setHovered(false)}
        onFocus={() => setFocused(true)}
        onBlur={() => setFocused(false)}
      >
        Auto
      </button>
    </MetalFx>
  );
}
.liquid-metal-toggle {
  background: #18181b;
  border-radius: 999px;
}

.liquid-metal-toggle__control {
  min-height: 40px;
  padding: 0 18px;
  color: #fafafa;
  background: transparent;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
}

.liquid-metal-toggle__control:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

Use paused t

자주 묻는 질문

금속 테두리가 버튼을 대신하나요?

아닙니다. 시각적 틀일 뿐이며, 실제 버튼이나 링크가 그대로 조작 요소로 남습니다.

모든 버튼에 쓰면 안 되나요?

이 스킬은 활성, 선택, 포커스, 주요 표면에만 쓰라고 말합니다.

밝은 모드와 어두운 모드에서 모두 작동하나요?

네. 다만 반사는 어두운 모드에서만 보이므로 두 모드를 따로 테스트해야 한다고 이 스킬은 말합니다.

상세 정보

작성자의 원본 설명

Add and tune animated liquid-metal WebGL borders with the React `metal-fx` package. Use when buttons, icon controls, chips, tabs, cards, or selected surfaces need a metallic active, selected, hover, focus, or premium border; when implementing the MetalFx component from metal.jakubantalik.com; or when troubleshooting its presets, themes, strength, glow, reflections, sizing, radius, animation, accessibility, SSR, or performance.

repo: MengTo/Skills

인기도

GitHub 스타
7.2k
순위
#13446
라이선스
MIT
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬