Skip to content

scroll-padding

Utilities for offsetting the snap port inside a scrollable container.

InteractivityTailwind v4 Spec
ISS preview
Iced + ISS preview demonstrating scroll-padding
ISS preview for scroll-padding
use iss::{scroll_box_tw, tw};
let carousel = scroll_box_tw(slides, tw!("overflow-x-auto snap-x snap-mandatory scroll-px-6"));
Tailwind Class CSS Property / Effect iss::typed Builder
scroll-p-<n> / scroll-px-<n> / scroll-py-<n> scroll-padding offsets; .scroll_p(4) / .scroll_px(4)
scroll-pt / pr / pb / pl-<n> Per-side scroll padding; .scroll_pt(6)
scroll-ps-<n> / scroll-pe-<n> Logical inline scroll padding; .scroll_ps(4) / .scroll_pe(4)
scroll-p-[16px] Arbitrary scroll padding; .scroll_p_px(16)
  • Use with scroll_box_tw and snap_offset_for_items; logical scroll-ps/pe-* flip automatically inside dir_rtl(...).

scroll-margin · scroll-snap-type · padding