liquid-metal-border
Qué hace
Esta skill guía a un agente de IA para añadir un borde metálico y animado en WebGL alrededor de un elemento de React, usando el paquete metal-fx. Es para desarrolladores que quieren un resaltado premium en controles seleccionados o activos.
Cuándo usarla
- ✓Cuando un botón, una tarjeta o una pestaña debe tener un borde metálico al estar seleccionado o activo.
- ✓Cuando un estado premium o al pasar el ratón necesita un borde de metal líquido.
- ✓Cuando un borde metálico necesita ajustes o corrección en un proyecto de React.
Link de la skill
https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/liquid-metal-border/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Añade un borde de metal líquido a la tarjeta de precios seleccionada en mi app de React, con un borde simple como alternativa.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente envuelve un elemento interactivo real con el componente de metal y vincula su animación al estado activo o seleccionado. Se mantiene un borde estático como alternativa, y los elementos inactivos se pausan para ahorrar recursos.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de 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
Preguntas frecuentes
¿El borde metálico sustituye al botón?
No. Es solo el marco visual, y el botón o el enlace real sigue siendo el control.
¿Por qué no ponerlo en todos los botones?
La skill indica reservarlo para superficies activas, seleccionadas, con foco o principales.
¿Funciona en modo oscuro y en modo claro?
Sí, pero la skill indica probar ambos por separado, ya que los reflejos solo se ven en modo oscuro.
Detalles
Descripción original del autor
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
Popularidad
- Estrellas en GitHub
- 7,2 mil
- Posición en el ranking
- #13446
- Licencia
- MIT
- Actualizada
- 1/11/2026
Comentarios
- …
Más skills de este repositorio
3d-cloth-material
7,2 milAyuda a tu agente a crear tela tejida realista en Three.js, con el entramado del hilo, un brillo suave, pliegues naturales, dobladillos y costuras.
3d-falling-leaves
7,2 milAyuda a tu agente a añadir hojas que caen de forma realista a una escena 3D, con hojas que giran, se dejan llevar por el viento y se reciclan al moverse la cámara.
3d-four-seasons
7,2 milAyuda a tu agente a añadir los aspectos de primavera, verano, otoño e invierno a una escena 3D, cambiando la vegetación, la luz, el cielo y la nieve sin reconstruirla.
3d-high-poly-models
7,2 milAyuda a tu agente a construir modelos 3D detallados con formas suaves y bordes creíbles, y después preparar versiones más ligeras que funcionen bien en la web.
Skills parecidas
angular-developer
280 milAyuda a tu agente con código de Angular y la estructura del proyecto. Útil para empezar proyectos, crear partes de código o mejorar el rendimiento y la accesibilidad.
frontend-a11y
280 milAyuda a tu agente a hacer que las interfaces web sean accesibles para todos. Asegura que sitios y apps funcionen bien con lectores de pantalla y navegación por teclado.
frontend-patterns
280 milHace que tu agente aplique patrones modernos en desarrollo frontend. Optimiza el rendimiento, gestiona el estado y sigue buenas prácticas en React y Next.js.