Custom Scrollbar

A custom scrollbar modifies the default browser scrollbar's appearance to match the website's design and improve overall user experience.

Basic usage

Add the .scrollbar class to a scrollable container to apply the custom scrollbar style.

Item 1

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

Item 2

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

Item 3

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

Item 4

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

Item 5

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

<div class="scrollbar h-80 overflow-auto">
  ...
</div>

Rounded bars

Use the .scrollbar-rounded class with .scrollbar to make the scrollbar rounded.

Item 1

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

Item 2

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

Item 3

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

Item 4

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

Item 5

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

<div class="scrollbar scrollbar-rounded h-80 overflow-auto">
  ...
</div>

Custom colors and sizes

Customize the scrollbar colors by using [&::-webkit-scrollbar-thumb]:bg-{color} for the thumb and [&::-webkit-scrollbar-track]:bg-{color} for the track. Adjust the scrollbar size using [&::-webkit-scrollbar]:w-* for vertical scrollbar width and [&::-webkit-scrollbar]:h-* for horizontal scrollbar height.

Item 1

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

Item 2

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

Item 3

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

Item 4

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

Item 5

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

<div class="scrollbar [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:bg-warning [&::-webkit-scrollbar-track]:bg-gray-700 h-80 overflow-auto">
  ...
</div>

Corners

By default, scrollbar corners are transparent. Customize them by adding the [&::-webkit-scrollbar-corner]:bg-{color} class to set a background color.

Item 1

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

Item 2

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

Item 3

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

Item 4

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

Item 5

Discover the principles of crafting clean, user-friendly interfaces that balance aesthetics and functionality. Learn how thoughtful color palettes, typography, and spacing can transform your digital experiences into visually appealing, intuitive designs that enhance user engagement and satisfaction across all devices and platforms.

<div class="scrollbar [&::-webkit-scrollbar-corner]:bg-info h-80 overflow-auto">
  ...
</div>

CSS variables

The custom scrollbar component is built using a set of CSS variables. These variables provide flexibility for customizing styles:

.scrollbar {
  --scrollbar-size: --spacing(3);
  --scrollbar-thumb-color: var(--background-color-emphasis);
  --scrollbar-track-color: var(--background-color-muted);
}