Now In Code
Get access

Repost Icon with Arrows Sliding on a Track

The icon never rotates: its two arrows slide along a rounded-rectangle track. Pressing winds them back slightly and shrinks them; releasing runs them half a lap, briefly closing into a loop, as the color turns green. HTML and react-native-svg share one core.

Inspired by a design by @alexabraham on XRebuilt from scratch by Now In Code

Agent prompt

Add the Now In Code component "repost-icon-sliding-arrows" to this project.

The full source is attached at the end of this prompt. Put the files under components/repost-icon-sliding-arrows/, install the listed dependencies with `npx expo install`, and render it on a route I can open.

Keep the timing and easing values documented in the source comments. Replace the sample copy and artwork with content from my app, or leave placeholders and list what I still need to supply.

=== Source files are attached here for paid plans ===
Pro piece. The prompt includes the full source.Get access

Details

Platforms
iOS, Android, Web
Requires
Expo SDK 54+
Access
Pro
Updated
16 Oct 2026
License
Unlimited commercial projects
Original design
@alexabraham on X

Are you the designer? Ask us to change or remove this.

CLI and MCP server Coming soon

Add pieces from the terminal or let your agent fetch them. Until then, Copy prompt does the same job. Docs

What it does

A single two-hook repost icon, with an arrow pointing up on the left and one pointing down on the right, centered on a black screen. Pressing it shrinks the icon to about nine tenths of its size and tilts it counterclockwise by roughly ten degrees. On release it spins about half a turn clockwise, overshoots a little and settles back with a damped wobble to its slight resting tilt. The stroke color changes from white to green or back during the spin. Because the shape is symmetric over a half turn, the result looks like the arrows slid around each other. The press time is configurable.

How it's built

The icon is a pair of stroked paths in react-native-svg, built from straight segments, quarter arcs and small arrowhead triangles. A shared JavaScript core computes scale, angle and color for each moment from the press and release events, using a measured spin curve followed by a spring settle. The component feeds that into an SVG group transform on a requestAnimationFrame loop and wraps it in a Pressable. There is no glow, shadow or blur, and no Reanimated.

Good for

  • A repost, share or toggle control in a social feed
  • A two-state action icon that needs a clear change on tap, such as follow or save
  • A micro-interaction for a toolbar button in a content app

Dependencies

react-native-svgreact-native

Tags

3D RotationButtonDark ModeIconMinimalPress FeedbackSocialSpring PhysicsState Transition

Related