Skip to content

No.520 · Micro-animations

Bookmark Fold

Saving pours colour down the ribbon from the top, drops it into its slot and flips the notch; a small “Saved” note rises.

The prompt

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

Written for the variant you picked above: Paper

Build a bookmark toggle (icon button, aria-pressed). The ribbon is an outlined SVG shape with a notched bottom; inside it, clipped to the same shape, a fill rectangle scaled on Y from the top. Saving: the fill pours down from the top (scaleY 0 → 1, 380ms ease-out), the ribbon drops 2px into its slot on a springy curve, the outline stretches a touch and settles (a short scaleY 1.06 → 0.97 → 1 keyframe from the top) like a ribbon catching, and a small amber "Saved" note rises above the button and fades over 1.4s. Unsaving drains the fill quickly upward. Amber (#f59e0b) is the saved colour. Selected variant — Paper (paper): Apply the paper theme. Where the brief above gives no colour values for it, choose a restrained paper palette with text at 4.5:1 contrast or better. Keep the geometry, states and motion described above unchanged. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Click, tap, Space or Enter to save and unsave. Motion: Fill 380ms; drop springy 360ms; catch 520ms after 260ms; note 1.4s. Accessibility: A toggle button with aria-pressed and a label naming what it saves; the note is decorative. Reduced motion changes state instantly with no note. Responsive behavior: A fixed-size control that sits inline wherever it's placed; nothing depends on screen width. Touch: Works the same on touch; there's no hover-only behaviour. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

Notes

Interaction
Click, tap, Space or Enter to save and unsave.
Motion
Fill 380ms; drop springy 360ms; catch 520ms after 260ms; note 1.4s.
Accessibility
A toggle button with aria-pressed and a label naming what it saves; the note is decorative. Reduced motion changes state instantly with no note.
Responsive
A fixed-size control that sits inline wherever it's placed; nothing depends on screen width.
On touch
Works the same on touch; there's no hover-only behaviour.