vibran

Swipe drawer, off-canvas sidebar

Portuguese name: Gaveta lateral com gesto

A mobile side menu that follows your finger: drag from the edge to open, drag the drawer to close, and on release it decides by speed and position. It also opens with a button, closes with Esc or a tap on the backdrop, and traps focus.

Preview of Swipe drawer, off-canvas sidebar running live
Copy the promptAdjust colors and speed

When to use it

For websites and apps on phones, where a fixed bar does not fit. The container (data-efeito) should fill the app screen and the gesture only works at the edge, so it does not fight carousels or scrolling; vertical scroll stays free. It also works with a mouse, which helps testing. Adjust data-borda if the zone is hard to hit, and use data-lado="direita" for a menu on the other side.

How to add it to your site

  1. Copy the prompt in the gallery. It comes with the effect's name and the full code. The prompt text is written in Portuguese, and AI builders handle that fine.
  2. Paste it into your AI: Lovable, Claude, Cursor, Bolt or v0.
  3. Done: the AI adds the effect to your project, just like you saw it here.

Use it in HTML

The effect is plain JavaScript, no library. Just put the data-efeito attribute on the element:

<div data-efeito="sidebar-gaveta-gesto" data-borda="28">
  <button data-abrir aria-label="Abrir menu"><svg>…</svg></button>
  <aside data-gaveta aria-label="Menu">
    <nav><a href="#">Cardápio</a></nav>
    <button data-fechar>Fechar</button>
  </aside>
  <main>…</main>
</div>

More sidebar effects

All 22 sidebar effects →