- Home
- Skills
- Frontend & Web Apps
- stretchy morph ui
stretchy morph ui
by pafemilk
Physics-based spring engine for creating organic, stretchy, and morphing web micro-interactions.
Free
stretchy morph ui
Example session with this skill installed
I have a standard React tab bar. Make it feel more fluid using the worm technique where the indicator stretches between tabs.
- Read your context and instructions
- Compiled the stretchy morph ui
I have analyzed the request for a stretchy tab bar. I will implement the "Edge Pair" technique using two springs with swapped stiffness to create the elastic worm effect.
Stretchy Worm Tabs Implementation
import React, { useEffect, useRef } from 'react';
import { Spring } from './stretchy-core';
// Spring presets for the "Worm" effect
const STIFF = { k: 450, c: 32 };
const SOFT = { k: 160, c: 18 };
export const StretchyTabs = ({ tabs, activeIndex, onChange }) => {
const containerRef = useRef(null);
const indicatorRef = useRef(null);
const leading = useRef(new Spring(0));
const trailing = useRef(new Spring(0));
useEffect(() => {
const target = containerRef.current.children[activeIndex].getBoundingClientRect();
const isMovingRight = activeIndex > (leading.current.x > target.left ? 1 : 0);
// Swap stiffness: leading edge is always stiffer
leading.current.config = isMovingRight ? STIFF : SOFT;
trailing.current.config = isMovingRight ? SOFT : STIFF;
leading.current.to(target.left + target.width);
trailing.current.to(target.left);
}, [activeIndex]);
// Animation loop writing directly to DOM for performance
useEffect(() => {
let frame;
const loop = () => {
leading.current.update();
trailing.current.update();
if (indicatorRef.current) {
const left = trailing.current.x;
const width = leading.current.x - left;
indicatorRef.current.style.transform = `translateX(${left}px) scaleX(${width})`;
}
frame = requestAnimationFrame(loop);
};
loop();
return () => cancelAnimationFrame(frame);
}, []);
return (
<div ref={containerRef} style={{ position: 'relative', display: 'flex' }}>
{tabs.map((tab, i) => (
<button key={i} onClick={() => onChange(i)} className={i === activeIndex ? 'on' : ''}>
{tab.label}
</button>
))}
<div ref={indicatorRef} className="indicator" />
</div>
);
};
Next steps
- Copy the
stretchy-core.jshelpers into your project. - Apply the
z-indexandisolationstyles defined in the Moving Indicators rulebook to prevent the indicator from overlapping text. - Run
scripts/check_page.pyto verify the "jump strip" for the tab transitions.
Connects securely to your tools. The creator never sees your data.
About this skill
Modern web interfaces often feel static, with state changes that jump instantly or follow rigid, linear easing curves. This lack of fluidity makes apps feel like a series of disconnected screens rather than a cohesive, physical object. This skill replaces standard CSS transitions with a high-performance spring engine, enabling interfaces that squash, stretch, and morph based on physical momentum.
What it does
- Physics-driven motion uses a damped harmonic oscillator engine for realistic spring dynamics rather than time-based easing.
- Dynamic morphing deforms UI elements during transitions, such as buttons transforming into loading indicators or tabs stretching like elastic.
- Fluid micro-interactions adds organic feedback like volume-preserving squashes, kicks, and lagging followers to standard controls.
- Code auditing scans existing projects to identify components that would benefit from elastic motion.
- Accessibility compliance automatically handles reduced-motion preferences to ensure inclusivity.
How it works
- Audit phase: Run
scripts/audit_ui.pyto scan your codebase for motion candidates and stack compatibility. - Design phase: Write a "morph sentence" for each interaction to define the cause and effect of the stretch.
- Implementation: Integrate the
stretchy-core.jsengine and map UI states to spring values (stiffness and damping). - Verification: Execute
scripts/check_page.pyto generate contact sheets and verify visual continuity across frames.
Frameworks & tools
Built for vanilla JS, React, Vue, and Svelte environments. It utilizes a custom semi-implicit Euler integration engine and headless browser scripts for visual testing.
Why this beats prompting it yourself
Writing physical spring logic that handles retargeting without resetting velocity is complex. This skill provides a battle-tested engine and a library of 24 reference components that solve common pitfalls like content reflow and layer ordering.
Use cases
- Navigation systems creating "worm" indicators for tabs or segmented controls.
- Interactive buttons that bulge, squeeze, or morph into status marks.
- Cart workflows throwing product items into a vibrating cart icon with arc physics.
- Dashboard transitions where cards expand into modals using split-axis springs.
Known limitations
Does not support time-based paths where the specific shape of the curve (like a circular arc) is required without manual coordination. Requires manual re-syncing on window resize or font load.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 9 days ago
- Free with an Agensi account
- Software
Python
Git
Permissions
What's inside
Creator
pafemilk
Frequently Asked Questions
New in Frontend & Web Apps
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Frontend & Web Apps.