drod-components

A Vue 3 component library — 60+ components, 45+ utility functions, and 4 directives — built and distributed as an ES/CJS dual-format npm package.
4,012
Install
npm install drod-components
Latest Version:2.5.1
Vue:3
License:MIT
Last Updated:Aug 16, 2026
Links: npm
Maintainer: thedrod

drod-components

A Vue 3 component library — 60+ components, 45+ utility functions, and 4 directives — built and distributed as an ES/CJS dual-format npm package.

  • npm: drod-components
  • License: MIT
  • Author: The Drod

Installation

npm install drod-components

Peer dependency — make sure Vue 3 is installed in your project:

npm install vue

Setup

Register globally in your main.js:

import { createApp } from 'vue'
import App from './App.vue'
import DrodComponents from 'drod-components'

const app = createApp(App)
app.use(DrodComponents)
app.mount('#app')

Or import individual components on demand:

import { DrodButton, DrodInput } from 'drod-components'

Components

Form

Component Description
DrodInput Text input with label/validation
DrodInputPassword Password input with visibility toggle
DrodCheckbox Checkbox with label
DrodSwitch Toggle switch
DrodMultiselect Multi-select dropdown (wraps @vueform/multiselect)
DrodCombobox Combobox with search
DrodDropdown Simple dropdown select
DrodToggleButton Segmented toggle button

Buttons & Controls

Component Description
DrodButton Primary button
DrodButtonFloating Floating action button
DrodButtonGroup Group of related buttons
DrodIcon MDI icon wrapper
DrodLink Styled anchor/router-link

Modals & Overlays

Component Description
DrodModalBase Base modal shell
DrodModalDelete Confirm-delete modal
DrodModalInfo Info/alert modal
DrodImageModal Full-screen image modal
DrodTooltip Tooltip wrapper

Media

Component Description
DrodVideo Standard video player
DrodVideoGif Looping gif-style video
DrodVideoScrubbable Scrub-on-hover video
DrodVideoSplitter Before/after video split
DrodYoutube YouTube embed
DrodMusicPlayer Audio player
DrodCarousel Image/content carousel
DrodCarouselSlider Slider variant

Layout

Component Description
DrodSidebar Sidebar with avatar, logo, nav items
DrodStackGrid Masonry-style stack grid
DrodHorizontalScroller Horizontally scrollable container
DrodVerticalSpacing Vertical rhythm spacer
DrodTabs Tab navigation

Display

Component Description
DrodBadge Status/count badge
DrodNotification Toast/notification
DrodProgressGroup Progress bar group
DrodTimelineVertical Vertical timeline
DrodMoodSelector Mood/emoji selector
DrodNoData Empty-state placeholder
DrodPortrait Avatar/portrait display
DrodLoading Loading spinner
DrodReloadPWA PWA reload prompt

Visual Effects

Component Description
DrodTextGlow Glowing text
DrodTextGradient Gradient text
DrodAnimatedGradient Animated gradient background
DrodBackgroundImage Background image with overlay
DrodRotateText Rotating text animation
DrodIconRotateHue Hue-rotating icon

Utility Components

Component Description
DrodDropFile Drag-and-drop file zone
DrodIframe Sandboxed iframe wrapper
DrodFloatingMenu Floating contextual menu
DrodMenuActions Action menu list
DrodMenuDropdown Dropdown menu
DrodMenuIcon Icon-triggered menu
DrodThemeSwitcher Light/dark theme toggle
DrodTerminal Terminal-style output
DrodLottie Lottie animation player
DrodMap Map container
DrodMapItem Map pin/item
DrodAccordion Accordion/collapse
DrodCharts Chart wrapper
DrodGopher Gopher mascot

Directives

Import and register manually:

import {
  DrodDirectiveOnClickOutside,
  DrodDirectiveFocus,
  DrodDirectiveDoubleClick,
  DrodDirectivelongPress,
} from 'drod-components'

app.directive('on-click-outside', DrodDirectiveOnClickOutside)
app.directive('focus', DrodDirectiveFocus)
app.directive('double-click', DrodDirectiveDoubleClick)
app.directive('long-press', DrodDirectivelongPress)
Directive Usage
v-on-click-outside Fires callback when clicking outside element
v-focus Auto-focuses element on mount
v-double-click Fires callback on double-click
v-long-press Fires callback on long press

Utilities

import { capitalizeText, isMobile, generateRandomId } from 'drod-components'

String

capitalizeText · capitalizeFirstLetter · camelizeText · escapeRegex · validateString

Arrays

shuffleArray · orderArrayOfObjects · randomIndex · randomIndexWithWeight · convertArrayToObject · convertArrayToArrayBuffer

Files & Assets

downloadFile · saveToJSON · getFileExtension · getAssetsImageUrl · getFirebaseImage · isVideo

Device & Environment

isMobile · isMobileData · isSmartwatch · isOnline · isPWA

DOM

appendToBody · findParentWithId · isDescendant · getCaretPosition · setCaretPosition

Data & Generation

generateRandomId · generateRandomNumber · generateRandomPassword · copyToClipboard · buildCombination

Misc

calculateAge · allowShare · compareVersions · isBrightColor · ThemeSwitcher · TouchEvent · tenPad · throttle · isFunction · isObject


Prep for Publish

Before publishing a new version, go through this checklist:

1. Bump the version

Edit package.json and increment the version following semver:

Change type Example
Patch (bug fix) 2.3.0 → 2.3.1
Minor (new feature, backwards-compatible) 2.3.0 → 2.4.0
Major (breaking change) 2.3.0 → 3.0.0

2. Build the package

npm run build

This runs Vite in library mode and outputs to dist/:

  • dist/drod-components.js — ES module
  • dist/drod-components.cjs — CommonJS

Verify the dist/ folder was created and looks correct before continuing.

3. Check what will be published

npm pack --dry-run

This lists exactly which files npm will include (controlled by the files field in package.json):

  • dist/*
  • src/**/*.vue

If something unexpected appears or something required is missing, fix package.json → files before publishing.

Install the packed tarball into another local project to catch import/runtime issues before they hit npm:

# In drod-components/:
npm pack
# This creates drod-components-x.x.x.tgz

# In your test project:
npm install /path/to/drod-components-x.x.x.tgz

Publishing to npm

First time only — log in to npm

npm login

Follow the prompts (username, password, OTP if 2FA is enabled). You only need to do this once per machine.

Verify you're logged in:

npm whoami

Publish

The publish script builds and publishes in one command:

npm run publish

This is equivalent to:

npm run build && npm publish --access public

The --access public flag is required for scoped packages but harmless for unscoped ones — it ensures the package is publicly accessible on the npm registry.

Verify it published

npm view drod-components

Or check npmjs.com/package/drod-components.

After publishing

  • Commit the version bump: git commit -am "chore: bump version to x.x.x"
  • Tag the release: git tag vx.x.x && git push --tags

Related Packages

vue

The progressive JavaScript framework for building modern web UI.

588,019,132 54,801
vue
@vueuse/shared
372,738,348 22,398
@vueuse/core

Collection of essential Vue Composition Utilities

367,188,523 22,398
@vitejs/plugin-vue

The official plugin for Vue SFC support in Vite.

333,357,380 686
eslint-plugin-vue

Official ESLint plugin for Vue.js

266,364,830 4,591

Version History

Version Released Vue License
2.5.1 ^3.5.21 MIT
2.5.0 ^3.5.21 MIT
2.4.2 ^3.5.21 MIT
2.4.1 ^3.5.21 MIT
2.4.0 ^3.5.21 MIT
Pre-releases (1)
Version Released Vue License
0.1.14-1 ^3.0.5 MIT