Communitygithub.com

ComeOnOliver/skillshub

Reanimated ejecuta animaciones en el hilo nativo de la UI, sin el cuello de botella del puente JS, sin fotogramas perdidos. Las animaciones se mantienen a 60 fps incluso cuando el hilo de JavaScript está ocupado. Utiliza 'worklets', pequeñas funciones JavaScript que se ejecutan en el hilo de la UI a través de JSI. Es el estándar para animaciones de calidad de producción en React Native: interacciones basadas en gestos, transiciones de diseño, efectos basados en desplazamiento y transiciones de elementos compartidos.

¿Qué es skillshub?

Este skill proporciona instrucciones detalladas y ejemplos de código para usar React Native Reanimated, una biblioteca que ejecuta animaciones directamente en el hilo nativo de la UI, eliminando el cuello de botella del puente JS y asegurando animaciones fluidas a 60 fps. Es útil para desarrolladores de React Native que necesitan animaciones de alto rendimiento más allá de simples cambios de opacidad o transformación, como gestos (deslizar para eliminar, arrastrar para reordenar, pellizcar para zoom), animaciones controladas por desplazamiento (efectos parallax, elementos pegajosos), animaciones de diseño (entrada/salida de elementos en listas) y transiciones de elementos compartidos entre pantallas. El skill explica cómo configurar la biblioteca y sus dependencias (como react-native-gesture-handler), y proporciona fragmentos de código prácticos para usar valores compartidos, estilos animados, gestos con Animation Gesture Handler, animaciones de diseño declarativas y animaciones basadas en desplazamiento con interpolación. También incluye dos ejemplos completos: una interfaz de deslizamiento estilo Tinder y una hoja inferior animada que se puede arrastrar y fijar en posiciones. Las pautas destacan el uso de valores compartidos en el hilo de la UI, estilos dinámicos con useAnimatedStyle, resortes para movimiento natural, runOnJS para llamar al hilo JS desde worklets, integración con Gesture Handler, animaciones de diseño declarativas con props entering/exiting, interpolación para mapear valores, y la importancia de que el plugin de Babel de Reanimated sea el último en la configuración.

Compatible con~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/TerminalSkills/skills/react-native-reanimated

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

React Native Reanimated

Resumen

Reanimated ejecuta animaciones en el hilo nativo de la UI, sin el cuello de botella del puente JS, sin fotogramas perdidos. Las animaciones se mantienen a 60 fps incluso cuando el hilo de JavaScript está ocupado. Utiliza "worklets" — pequeñas funciones JavaScript que se ejecutan en el hilo de la UI a través de JSI. Es el estándar para animaciones de calidad de producción en React Native: interacciones basadas en gestos, transiciones de diseño, efectos basados en desplazamiento y transiciones de elementos compartidos.

Cuándo Usarlo

  • Cualquier animación en React Native más allá de simple opacidad/transformación
  • Interacciones basadas en gestos (deslizar para eliminar, arrastrar para reordenar, pellizcar para zoom)
  • Animaciones controladas por desplazamiento (encabezados parallax, elementos pegajosos)
  • Animaciones de diseño (elementos que entran/salen de listas)
  • Transiciones de elementos compartidos entre pantallas

Instrucciones

Configuración

npx expo install react-native-reanimated react-native-gesture-handler
// babel.config.js — Agrega el plugin de Reanimated (DEBE ser el último)
module.exports = function (api) {
  api.cache(true);
  return {
    presets: ["babel-preset-expo"],
    plugins: ["react-native-reanimated/plugin"],  // ¡Debe ser el último!
  };
};

Valores Compartidos y Estilos Animados

// components/FadeIn.tsx — Animación básica con valores compartidos
import Animated, {
  useSharedValue,
  useAnimatedStyle,
  withTiming,
  withSpring,
} from "react-native-reanimated";
import { useEffect } from "react";

export function FadeInCard({ children }) {
  const opacity = useSharedValue(0);
  const translateY = useSharedValue(20);

  useEffect(() => {
    opacity.value = withTiming(1, { duration: 600 });
    translateY.value = withSpring(0, { damping: 15 });
  }, []);

  const animatedStyle = useAnimatedStyle(() => ({
    opacity: opacity.value,
    transform: [{ translateY: translateY.value }],
  }));

  return (
    <Animated.View style={animatedStyle} className="bg-white rounded-xl p-4 shadow-lg">
      {children}
    </Animated.View>
  );
}

Animaciones con Gestos

// components/SwipeToDelete.tsx — Gesto de deslizar con animación
import Animated, {
  useSharedValue,
  useAnimatedStyle,
  withSpring,
  runOnJS,
} from "react-native-reanimated";
import { Gesture, GestureDetector } from "react-native-gesture-handler";

export function SwipeToDelete({ onDelete, children }) {
  const translateX = useSharedValue(0);

  const pan = Gesture.Pan()
    .onUpdate((event) => {
      // Solo permitir deslizar hacia la izquierda
      translateX.value = Math.min(0, event.translationX);
    })
    .onEnd((event) => {
      if (event.translationX < -150) {
        // Deslizó lo suficiente — eliminar
        translateX.value = withSpring(-400);
        runOnJS(onDelete)();
      } else {
        // Volver a la posición original
        translateX.value = withSpring(0);
      }
    });

  const animatedStyle = useAnimatedStyle(() => ({
    transform: [{ translateX: translateX.value }],
  }));

  return (
    <GestureDetector gesture={pan}>
      <Animated.View style={animatedStyle}>
        {children}
      </Animated.View>
    </GestureDetector>
  );
}

Animaciones de Diseño

// components/AnimatedList.tsx — Los elementos se animan al entrar/salir automáticamente
import Animated, { FadeInDown, FadeOutLeft, LinearTransition } from "react-native-reanimated";

export function AnimatedList({ items, onRemove }) {
  return (
    <Animated.FlatList
      data={items}
      itemLayoutAnimation={LinearTransition}
      renderItem={({ item, index }) => (
        <Animated.View
          entering={FadeInDown.delay(index * 100).springify()}
          exiting={FadeOutLeft.duration(300)}
          className="bg-white p-4 mx-4 my-1 rounded-lg"
        >
          <Text>{item.title}</Text>
          <Pressable onPress={() => onRemove(item.id)}>
            <Text className="text-red-500">Eliminar</Text>
          </Pressable>
        </Animated.View>
      )}
    />
  );
}

Animaciones Basadas en Desplazamiento

// components/ParallaxHeader.tsx — Efecto parallax al hacer scroll
import Animated, {
  useAnimatedScrollHandler,
  useSharedValue,
  useAnimatedStyle,
  interpolate,
} from "react-native-reanimated";

export function ParallaxHeader() {
  const scrollY = useSharedValue(0);

  const scrollHandler = useAnimatedScrollHandler({
    onScroll: (event) => {
      scrollY.value = event.contentOffset.y;
    },
  });

  const headerStyle = useAnimatedStyle(() => ({
    height: interpolate(scrollY.value, [-100, 0, 200], [400, 300, 100]),
    opacity: interpolate(scrollY.value, [0, 200], [1, 0.3]),
    transform: [
      { translateY: interpolate(scrollY.value, [0, 200], [0, -50]) },
    ],
  }));

  return (
    <>
      <Animated.View style={headerStyle} className="bg-blue-600">
        <Text className="text-white text-3xl font-bold">Mi App</Text>
      </Animated.View>
      <Animated.ScrollView onScroll={scrollHandler} scrollEventThrottle={16}>
        {/* Contenido */}
      </Animated.ScrollView>
    </>
  );
}

Ejemplos

Ejemplo 1: Construye una interfaz de deslizamiento de tarjetas

Solicitud del usuario: "Construye una interfaz de deslizamiento de tarjetas estilo Tinder con animaciones suaves."

El agente creará un mazo de tarjetas con gestos de arrastre, rotación basada en la dirección del deslizamiento, animaciones con resorte para volver a la posición inicial y transiciones de diseño para la eliminación de tarjetas.

Ejemplo 2: Hoja inferior animada

Solicitud del usuario: "Crea una hoja inferior que se pueda arrastrar hacia arriba y que se fije en posiciones."

El agente usará gestos de arrastre con puntos de anclaje, valores compartidos para la altura y animaciones con resorte para un ajuste suave.

Pautas

  • Valores compartidos para el estado de animación — useSharedValue se ejecuta en el hilo de la UI
  • useAnimatedStyle para estilos dinámicos — se recalcula en el hilo de la UI
  • withSpring para movimiento natural — withTiming para duración precisa
  • runOnJS para llamar a JS desde worklets — puente de regreso al hilo JS cuando sea necesario
  • Integración con Gesture Handler — Gesture.Pan(), Gesture.Pinch(), etc.
  • Las animaciones de diseño son declarativas — props entering, exiting en componentes Animated
  • interpolate para mapeo de valores — mapear posición de desplazamiento a opacidad, escala, etc.
  • El plugin de Babel debe ser el último — react-native-reanimated/plugin al final del array de plugins
  • No acceder a objetos JS en worklets — solo valores compartidos y primitivos
  • scrollEventThrottle={16} — eventos de desplazamiento a 60 fps para animaciones suaves

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

Skills relacionados