Vue 3 custom scroll area component library with DOM-level custom scrollbar.
- Vue 3.5+ / TypeScript 5.8+ / Vite 7.0+
- pnpm 10.13.1 + workspaces
- dprint (formatting) / oxlint (linting)
- husky + lint-staged (Git Hooks)
packages/
├── scroll-area/ # Main library (vue-scroll-area)
│ ├── src/components/ # Vue components and core logic
│ │ ├── ScrollArea.vue # Main component
│ │ ├── setup-scroll.ts # Core scroll logic
│ │ ├── public-types.ts # Public types
│ │ └── index.css # Component styles
│ └── dist/ # Build output
└── playground/ # Dev/demo app
# Development
pnpm dev # Run both lib and playground
pnpm dev:lib # Library only (watch mode)
pnpm dev:playground # Playground only
# Build
pnpm build # Build library
# Code quality
pnpm format # Format files (use first)
pnpm lint:fix # Auto-fix lint errors (use first)
pnpm lint # Check lintAlways try auto-fix first, do not manually edit:
pnpm lint:fix
pnpm format| Context | Language |
|---|---|
| User interaction | Chinese |
| Documentation, code comments | English |
| Source code | English |
| Commit messages | English |
- Use
<script setup lang="ts"> - Styles in
index.css(not scoped), BEM naming.scroll-area-* - Use CSS variables for dynamic values, not inline styles
- If playground doesn't see changes, ensure lib is built (
pnpm dev:lib) - If types don't resolve, run
pnpm buildto generate declarations - No need to kill and restart the dev server — this project supports HMR