Bottom Sheet

The mobile sheet you can flick away with your thumb

Create a draggable bottom sheet. A panel that springs up from the bottom of the screen (the mobile pattern) and can be dismissed by dragging it down or tapping the backdrop. Opening: from transform: translateY(100%) to 0 with a spring (stiffness ~400, damping ~36), over a fading backdrop. The sheet has top-only rounded corners (16-20px), an upward shadow, and a grab handle: a 34x4px rounded bar centered at the top, which signals draggability. Dragging: the sheet follows the finger downward (never above its open position; allow a small elastic overshoot). On release: if dragged more than ~40% of its height or flicked with high velocity, dismiss (animate off-screen); otherwise spring back to open. With Framer Motion use drag='y' with dragConstraints and onDragEnd checking offset and velocity; vanilla needs pointer events + touch-action: none. Behavior: Escape and backdrop click close it, focus is trapped, body scroll locked while open, role='dialog'. Under prefers-reduced-motion, open and close with plain fades and disable the drag-to-dismiss gesture (keep a close button). Build the component, not this demo of it. - Ambient motion that IS the component may loop: a drifting background, a marquee, a spinner while something is genuinely loading. - Do not add any timer, interval, loop or script that performs a person's action by itself. No auto-hover, no auto-click, no cycling through states, no pretend submitting, no replaying the interaction on a schedule. - Every state that answers a person waits for a real event from that person. - Placeholder copy and sample content are welcome. Simulated behaviour is not.

Rate it
0
0

We'd like to measure how the site gets used, with Google Analytics. It sets cookies. Everything the site needs to work runs either way. How we handle data