# Toggle Spring

> Toggle Spring is an Agent Skill for design published in the nexu-io/motion-anything repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

A switch whose knob springs across on toggle — a tactile, satisfying on/off state change. Use for settings/form switches. Honors prefers-reduced-motion (quick linear slide). Trigger on user intent only; keep the spring subtle — never to convey loading/progress.

- Skill name: `toggle-spring`
- Category: [Design](https://www.openparable.com/skill/design/1)
- Source: https://github.com/nexu-io/motion-anything/blob/HEAD/recipes/web/toggle-spring/SKILL.md
- Repository: nexu-io/motion-anything (466 GitHub stars when collected)

## SKILL.md

# toggle-spring

A switch whose knob springs across on toggle. Part of
[motion-anything](https://github.com/nexu-io/motion-anything); obeys `MOTION-SPEC.md`.

## When to use it
- On/off switches in settings and forms; any binary state the user flips themselves.

## When NOT to use it (restraint)
- To convey loading/progress (use a spinner/skeleton). Keep the overshoot subtle, not gimmicky.

## How to apply
1. Copy `toggle-spring.css` and `toggle-spring.js` and link them.
2. Markup: `<button class="ms-toggle" data-toggle aria-pressed="false"><span class="knob"></span></button>`.

## Accessibility & performance
- `prefers-reduced-motion`: quick linear slide, no overshoot. `aria-pressed` reflects state. Transform only.

---

Source: https://www.openparable.com/skill/design/toggle-spring (OpenParable). Cite the canonical URL above.
