Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

tailwind-scrollbar-hide

reslear881.5kMIT4.0.0TypeScript support: included

tailwindcss plugin for hide scrollbar

tailwindcss, scrollbar, scrollbar-hide

readme

tailwind-scrollbar-hide

npm npm npm install size

Tailwind plugin for hide scrollbars, although the element can still be scrolled if the element's content overflows.

tailwind-scrollbar-hide animation demo

🕹 Live Playground

Features

🎨 Tailwind v4.x, v3.x, v2.x.

📦 Zero dependencies

🛠️ Port for unocss-preset-scrollbar-hide

🎯 Pure CSS implementation for v4.x

Installation

Install the plugin from npm:

# Using npm
npm install tailwind-scrollbar-hide

# Using pnpm
pnpm add tailwind-scrollbar-hide

# Using Yarn
yarn add tailwind-scrollbar-hide

Tailwind v4 support

Firefox >=64 Chrome >= 2 Safari >= 4

For Tailwind v4, you can use the following approach in your CSS configuration file:

/* index.css */
@import 'tailwindcss';
@import 'tailwind-scrollbar-hide/v4';

This will automatically import and configure the plugin for Tailwind v4.

Note: Internet Explorer functionality has been dropped in Tailwind v4

Tailwind v2.x, v3.x support

Firefox >=64 Chrome >= 2 Safari >= 4 Internet Explorer >= 10

For Tailwind v2.x and v3.x, add the plugin to your config file:

// tailwind.config.js
module.exports = {
  theme: {
    // ...
  },
  plugins: [
    require('tailwind-scrollbar-hide')
    // ...
  ]
}

or using TypeScript:

// tailwind.config.ts
import type { Config } from 'tailwindcss'
import scrollbarHide from 'tailwind-scrollbar-hide'

export default {
  theme: {
    // ...
  },
  plugins: [scrollbarHide]
} satisfies Config

Usage

Use in you template scrollbar-hide for visual hiding scrollbar

<div class="w-4 scrollbar-hide">...</div>

or restore default value use scrollbar-default

⚠️ webkit overriding not working https://github.com/reslear/tailwind-scrollbar-hide/issues/19#issuecomment-1086949110 need switch breakpoint system

<div class="w-4 scrollbar-hide md:scrollbar-default">...</div>

Plugin Inspiration

License

MIT

changelog

v4.0.0

compare changes

🚀 Enhancements

  • ⚠️ V4 support (#32)

💅 Refactors

  • playground: Use native custom component (cc2f089)
  • playground: Format html (391b317)

⚠️ Breaking Changes

  • ⚠️ V4 support (#32)

❤️ Contributors

v2.0.0

compare changes

🩹 Fixes

⚠️ Breaking Changes

❤️ Contributors

v1.3.1

compare changes

🩹 Fixes

📖 Documentation

❤️ Contributors

v1.3.0

compare changes

🚀 Enhancements

  • Tailwind v3 (#26)

❤️ Contributors

1.1.7 (2021-12-20)

Bug Fixes

  • sync npm readme, clean file (2b13483)

1.1.6 (2021-11-23)

Bug Fixes

1.1.5 (2021-10-31)

Bug Fixes

  • add enter to the function in index.js (#17) (511e8a4)

1.1.4 (2021-10-31)

Bug Fixes

1.1.3 (2021-10-31)

Bug Fixes

1.1.2 (2021-10-31)

Bug Fixes

1.1.1 (2021-10-31)

Bug Fixes