Toggle switch
Slide a thumb between two resting positions while the track changes color.
Use a real checkbox and keep the checked state available to assistive technology.
transition: transform 200ms ease-out, background-color 200ms ease-out;Input feedback
Controls should acknowledge input immediately, make the new state unmistakable, and stay usable with a keyboard or reduced motion. The animation supports the state change; it never becomes the only evidence that anything happened.
Pattern examples
Hover, focus, press, or toggle the specimens. Each recipe keeps the durable state in semantic markup and uses animation as a supporting layer.
Slide a thumb between two resting positions while the track changes color.
Use a real checkbox and keep the checked state available to assistive technology.
transition: transform 200ms ease-out, background-color 200ms ease-out;Grow the field on focus to reveal more room without moving unrelated controls.
Reserve enough layout space for the expanded width so the page does not jump.
transition: inline-size 200ms ease-out;
&:focus { inline-size: 16rem; }Reveal the check after the box changes state, keeping the confirmation compact.
Pair the visual mark with the native checked property; never animate a decorative box alone.
transition: background-color 150ms ease-out, transform 150ms ease-out;Nudge a value upward after an add action to connect the click with its result.
Announce meaningful total changes in a polite live region when they are not otherwise obvious.
animation: counter-rise 200ms ease-out;Compress a button slightly while it is pressed so pointer input feels tactile.
Keep the scale change subtle and preserve an obvious focus-visible ring.
transition: transform 120ms ease-out;
&:active { transform: scale(.97); }Implementation check
Test keyboard focus, touch, reduced motion, slow work, failure, repeated activation, and the final resting state. A robust interaction remains understandable when every transition is removed.
@media (prefers-reduced-motion: reduce) {
.motion {
animation: none;
transform: none;
transition-duration: 0.01ms;
}
}Continue the reference
Compare the neighboring feedback patterns before choosing an effect.
Map the components and states around these interactions, then generate the project structure from one visual workspace.
We'd like to use Google cookies to understand how Nodlume is used and to measure our advertising. Nothing loads until you choose, and declining does not affect anything in the app.