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가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“React 앱의 선택된 가격 카드에 액체 금속 테두리를 추가해 주세요. 대체용으로 일반 테두리를 남겨 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 실제 상호작용 요소 하나를 금속 컴포넌트로 감싸고, 그 애니메이션을 활성 또는 선택 상태에 연결합니다. 정적인 테두리가 대체 화면으로 남으며, 비활성 항목은 자원을 아끼기 위해 멈춥니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Liquid Metal Border
Core Contract
- Use
metal-fxin React 18 or newer. - Wrap exactly one real host element such as a
button,a,div, orarticle. - Keep the host semantic and interactive.
MetalFxis visual framing, not the control. - Reserve the animated border for active, selected, focused, hovered, or primary surfaces. Do not put it around every control.
- Keep a static CSS border or focus outline as the fallback. WebGL decoration must never carry essential state by itself.
- Pause non-active instances and reduced-motion experiences.
- Test light and dark modes independently. Reflections intentionally render only in dark mode.
Inspect Before Editing
- Confirm the project uses React and has
reactandreact-domversion 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-fxversion 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.
댓글
- …
이 저장소의 다른 스킬
3d-cloth-material
7.2k에이전트가 Three.js에서 실 짜임, 부드러운 광택, 자연스러운 주름, 단, 솔기를 갖춘 실제 직물처럼 보이는 천을 만들도록 돕습니다.
3d-falling-leaves
7.2k에이전트가 3D 장면에 나뭇잎이 구르고 바람에 흩날리며 카메라 움직임에 따라 재사용되는 낙엽 효과를 추가하도록 돕습니다.
3d-four-seasons
7.2k에이전트가 3D 장면의 나무, 빛, 하늘, 눈을 바꿔 장면을 다시 만들지 않고 봄, 여름, 가을, 겨울을 표현하도록 돕습니다.
3d-high-poly-models
7.2k에이전트가 매끄러운 형태와 자연스러운 모서리를 가진 세밀한 3D 모델을 만들고, 웹에서 잘 돌아가는 가벼운 버전을 준비하도록 돕습니다.
비슷한 스킬
angular-developer
280k에이전트가 Angular 코드를 만들고 프로젝트 구조를 조언하도록 돕습니다. 새 프로젝트 시작, 코드 부분 생성, 성능과 접근성 개선에 유용합니다.
frontend-a11y
280k모든 사람이 웹 인터페이스를 쓸 수 있도록 에이전트를 돕습니다. 웹사이트와 앱이 화면 읽기 프로그램과 키보드 탐색에서 잘 작동하도록 합니다.
frontend-patterns
280k프론트엔드 개발의 현대적인 패턴을 적용하도록 에이전트를 돕습니다. React와 Next.js에서 성능을 최적화하고, 상태를 관리하며, 모범 사례를 따릅니다.