Communitygithub.com

ComeOnOliver/skillshub

Reanimated führt Animationen auf dem nativen UI-Thread aus – kein JS-Bridge-Engpass, keine ausgelassenen Frames. Animationen laufen mit 60fps, selbst wenn der JavaScript-Thread ausgelastet ist.

Was ist skillshub?

Dieses Skill beschreibt, wie React Native Reanimated verwendet wird, um flüssige Animationen mit 60 Bildern pro Sekunde zu erstellen. Es basiert auf "Worklets", kleinen JavaScript-Funktionen, die über JSI direkt auf dem UI-Thread ausgeführt werden und so den JS-Bridge-Engpass vermeiden. Der Skill behandelt die Einrichtung, einschließlich der Installation und Konfiguration des Babel-Plugins, und bietet detaillierte Codebeispiele für verschiedene Animationstypen: Shared Values und animierte Styles, Gesten-basierte Animationen (z.B. Wischen zum Löschen), Layout-Animationen für Listen und scrollgetriebene Effekte wie Parallax-Header. Die Beispiele zeigen häufig verwendete Muster wie Tinder-ähnliche Karten-Swiper oder animierte Bottom-Sheets. Das Skill ist für Entwickler gedacht, die in React Native über einfache Opazitäts- und Transform-Animationen hinausgehen und produktionsreife, gestengetriebene Interaktionen umsetzen möchten.

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

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

React Native Reanimated

Übersicht

Reanimated führt Animationen auf dem nativen UI-Thread aus – kein JS-Bridge-Engpass, keine ausgelassenen Frames. Animationen laufen mit 60fps, selbst wenn dein JavaScript-Thread ausgelastet ist. Es verwendet "Worklets" – kleine JavaScript-Funktionen, die über JSI auf dem UI-Thread ausgeführt werden. Der Standard für produktionsreife Animationen in React Native: gestengetriebene Interaktionen, Layout-Übergänge, scrollbasierte Effekte und Shared-Element-Übergänge.

Wann verwenden

  • Jede Animation in React Native, die über einfache Opazität/Transform hinausgeht
  • Gestengesteuerte Interaktionen (Wischen zum Löschen, Ziehen zum Neuanordnen, Pinch-to-Zoom)
  • Scrollgesteuerte Animationen (Parallax-Header, klebrige Elemente)
  • Layout-Animationen (Elemente, die in Listen erscheinen/verschwinden)
  • Shared-Element-Übergänge zwischen Bildschirmen

Anleitung

Einrichtung

npx expo install react-native-reanimated react-native-gesture-handler
// babel.config.js – Reanimated-Plugin hinzufügen (MUSS das letzte sein)
module.exports = function (api) {
  api.cache(true);
  return {
    presets: ["babel-preset-expo"],
    plugins: ["react-native-reanimated/plugin"],  // Muss das letzte sein!
  };
};

Shared Values und animierte Styles

// components/FadeIn.tsx – Einfache Animation mit Shared Values
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>
  );
}

Gesten-Animationen

// components/SwipeToDelete.tsx – Wischgeste mit Animation
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) => {
      // Nur nach links wischen zulassen
      translateX.value = Math.min(0, event.translationX);
    })
    .onEnd((event) => {
      if (event.translationX < -150) {
        // Weit genug gewischt – löschen
        translateX.value = withSpring(-400);
        runOnJS(onDelete)();
      } else {
        // Zurückschnappen
        translateX.value = withSpring(0);
      }
    });

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

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

Layout-Animationen

// components/AnimatedList.tsx – Elemente animieren automatisch ein/aus
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">Entfernen</Text>
          </Pressable>
        </Animated.View>
      )}
    />
  );
}

Scrollgesteuerte Animationen

// components/ParallaxHeader.tsx – Parallax-Effekt beim Scrollen
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">Meine App</Text>
      </Animated.View>
      <Animated.ScrollView onScroll={scrollHandler} scrollEventThrottle={16}>
        {/* Inhalt */}
      </Animated.ScrollView>
    </>
  );
}

Beispiele

Beispiel 1: Karten-Swipe-Oberfläche erstellen

Benutzeraufforderung: "Erstelle eine Tinder-ähnliche Karten-Swipe-Oberfläche mit flüssigen Animationen."

Der Agent erstellt einen Kartenstapel mit Pan-Gesten, Rotation basierend auf der Wischrichtung, Spring-Animationen für das Zurückschnappen und Layout-Übergänge für das Entfernen von Karten.

Beispiel 2: Animiertes Bottom-Sheet

Benutzeraufforderung: "Erstelle ein Bottom-Sheet, das nach oben gezogen werden kann und an Positionen einrastet."

Der Agent verwendet Pan-Gesten mit Einrastpunkten, Shared Values für die Höhe und Spring-Animationen für sanftes Einrasten.

Richtlinien

  • Shared Values für Animationszustand – useSharedValue läuft auf dem UI-Thread
  • useAnimatedStyle für dynamische Styles – wird auf dem UI-Thread neu berechnet
  • withSpring für natürliche Bewegung – withTiming für präzise Dauer
  • runOnJS um JS von Worklets aus aufzurufen – Brücke zurück zum JS-Thread, wenn nötig
  • Gesture Handler Integration – Gesture.Pan(), Gesture.Pinch(), usw.
  • Layout-Animationen sind deklarativ – entering, exiting Props auf animierten Komponenten
  • interpolate für Wertezuordnung – Scrollposition auf Opazität, Skalierung usw. abbilden
  • Babel-Plugin muss das letzte sein – react-native-reanimated/plugin am Ende des Plugins-Arrays
  • Greife in Worklets nicht auf JS-Objekte zu – nur Shared Values und Primitive
  • scrollEventThrottle={16} – Scroll-Ereignisse mit 60fps für flüssige Animationen

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

Verwandte Skills