Animated Triangle - Reanimated v4

A flexible React Native Reanimated component that arranges and animates elements within a rotating triangular layout. The component accepts a list of items and smoothly transitions between them based on the `activeIndex`. You can customize its size, orientation, colors, and animation behavior to create visually dynamic UIs. The `renderItem` function receives an `active` boolean, allowing you to apply React Native Reanimated v4 CSS transitions directly to the element — as shown in `example.tsx`. **Props** - `width`, `height`: Dimensions of the triangle container. - `orientation`: Direction of the triangle — `"up"`, `"down"`, `"left"`, or `"right"`. - `inset`: Inner padding for positioning items. - `fill`, `stroke`, `strokeWidth`: Control the triangle’s visual style. - `data`: Array of items to render. - `renderItem`: Function that renders each item and provides an `active` boolean indicating if the item is currently active. - `activeIndex`: Currently active item index, driving the animation. - `onIndexChange`: Callback triggered when the active index changes. - `style`: Additional view styling.

Scan the QR to check the animation on your device.

Install the app:

iOS|Android