Dev Helpers
← Back

Snap a horizontal card rail

Snap a horizontal card rail with Tailwind CSS 4 utilities. The preview uses precompiled styles.

Open this example in the interactive library

Source code

<div
  class="demo flex overflow-x-auto snap-x snap-mandatory gap-2 w-52 [&_.tile]:flex-[0_0_90%] [&_.tile]:snap-start"
>
  <span class="tile">One</span><span class="tile">Two</span
  ><span class="tile">Three</span>
</div>