scroll component

Drop-in semantic component. See examples, sizes, variants, and source.

Styled scroll container that customizes the native browser scrollbar. scroll defaults to vertical scrolling on a white track — switch to horizontal for an x-axis container, swap to subtle for a tinted look, and pick a scrollbar width with xs / sm / xl / lg. Wrap several scrolls in a scrolls parent to inherit the size and style. Programmatic scroll helpers live in scroll.js.

Size Variants

Tiny (10px scrollbar)

Tiny Scrollbar

Perfect for compact interfaces and minimal designs.

  • • Compact 10px scrollbar width
  • • Ideal for sidebars
  • • Minimal visual weight
  • • Mobile-friendly
  • • Best for small containers
  • • Less obtrusive design
  • • Saves screen space
  • • Modern aesthetic

Small (12px scrollbar)

Small Scrollbar

Great balance between visibility and subtlety.

  • • Standard 12px scrollbar width
  • • Good for most use cases
  • • Balanced visibility
  • • Works well on tablets
  • • Commonly used size
  • • Easy to interact with
  • • Not too prominent
  • • Versatile option

Default (16px scrollbar)

Default Scrollbar

Standard size for most applications. No class needed - this is the default!

Key Features
  • • Comfortable 16px scrollbar width
  • • Optimal for desktop interfaces
  • • Easy to grab and drag
  • • Clear visual indicator
  • • Accessible for all users
  • • WCAG compliant sizing
  • • Cross-browser consistent
  • • Recommended standard
Use Cases

Perfect for content areas, document viewers, list containers, and general-purpose scrolling.

Large (20px scrollbar)

Large Scrollbar

More prominent scrollbar for better visibility and easier interaction.

  • • Prominent 20px scrollbar width
  • • Excellent visibility
  • • Very easy to target
  • • Great for touch interfaces
  • • Accessibility-focused
  • • Clear visual feedback
  • • Good for presentations
  • • High contrast option

Big (24px scrollbar)

Big Scrollbar

Maximum visibility and easiest interaction for accessibility.

  • • Extra large 24px scrollbar width
  • • Maximum visibility
  • • Easiest to interact with
  • • Perfect for accessibility needs
  • • Touch-optimized design
  • • High DPI screen friendly
  • • Kiosk mode interfaces
  • • Senior-friendly design

Style Variants

Default Style (White Background)

Default Style

Clean white background with light gray scrollbar. Most commonly used for content areas.

  • • White background (##ffffff)
  • • Light gray scrollbar (##ebebeb)
  • • Subtle hover effect
  • • Clean appearance
  • • Most common style
  • • Professional look
  • • High contrast text
  • • Easy to read

Subtle Style (Gray Background)

Subtle Style

Soft gray background with darker scrollbar. Great for sidebars and secondary content.

  • • Gray background (##f7f7f7)
  • • Darker gray scrollbar (##d1d1d1)
  • • More prominent hover
  • • Minimalistic design
  • • Less distracting
  • • Good for sidebars
  • • Blends with UI
  • • Modern aesthetic

Horizontal Scrolling

Horizontal Scroll with Cards

Card 1

Horizontal scrolling example with cards.

Card 2

Scroll horizontally to see more cards.

Card 3

Great for image galleries and carousels.

Card 4

Supports touch gestures on mobile.

Card 5

Smooth scrolling with momentum.

Card 6

Last card in this example.

Container-Level Inheritance

Using .scrolls Container

Inherited Small + Subtle

This scroll inherits small size and subtle style from the parent .scrolls container.

  • • No classes needed on children
  • • Consistent styling across group
  • • Easy to maintain
  • • DRY principle
Also Inherited

This scroll also inherits the same properties automatically.

  • • Same size and style
  • • No duplication needed
  • • Clean markup
  • • Scalable approach

Class API Reference

Type Class Usage Notes
Base scroll Required scrollable container Set max-height (vertical) or width (horizontal) for scroll to engage
content Inner padded wrapper Optional but recommended
Sizes (Scrollbar Width) xs 10px scrollbar — tiny Modifier on scroll
sm 12px scrollbar — small Modifier on scroll
(default) 16px scrollbar — medium No size class needed
xl 20px scrollbar — large Modifier on scroll
lg 24px scrollbar — big Modifier on scroll
Style (default) White background, light grey scrollbar No style class needed
subtle Soft grey background, darker scrollbar Modifier on scroll
Direction (default) Vertical scrolling (overflow-y) No direction class needed
horizontal Horizontal scrolling (overflow-x) Modifier on scroll; pair with inline-flex children
Wrapper scrolls Parent container — children inherit size + style modifiers e.g. scrolls sm subtle
scrolls.xs|sm|xl|lg / scrolls.subtle Inheritance modifiers on the parent Children pick up scrollbar width and style