npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@bw-ui/datepicker-vue

v1.1.0

Published

Vue bindings for @bw-ui/datepicker - Component and composables for Vue 3 applications

Readme

@bw-ui/datepicker-vue

Vue 3 bindings for the BW DatePicker library.

Version License Size

Core Documentationnpm

✨ Features

  • 🪶 Lightweight - Only ~5KB gzipped
  • 💚 Vue 3 - Composition API support
  • 🔌 Full Plugin Support - Use all BW DatePicker plugins
  • 🎣 Composable API - useBWDatePicker for headless usage
  • 📘 TypeScript - Full type definitions included
  • 🔄 SSR Ready - Works with Nuxt out of the box

📦 Installation

npm install @bw-ui/datepicker @bw-ui/datepicker-vue

🚀 Quick Start

Component

<script setup>
import { ref } from 'vue';
import { BWDatePicker } from '@bw-ui/datepicker-vue';
import '@bw-ui/datepicker/css';

const date = ref(null);
</script>

<template>
  <BWDatePicker v-model="date" placeholder="Select a date" />
</template>

Composable

<script setup>
import { useBWDatePicker } from '@bw-ui/datepicker-vue';
import '@bw-ui/datepicker/css';

const { inputRef, date, open, close } = useBWDatePicker({
  onChange: (date) => console.log('Selected:', date),
});
</script>

<template>
  <div>
    <input ref="inputRef" placeholder="Select date" />
    <button @click="open">Open</button>
  </div>
</template>

🔌 Using Plugins

All BW DatePicker plugins work with the Vue wrapper:

npm install @bw-ui/datepicker-theming @bw-ui/datepicker-locale

{% raw %}

<script setup>
import { ref } from 'vue';
import { BWDatePicker } from '@bw-ui/datepicker-vue';
import { ThemingPlugin } from '@bw-ui/datepicker-theming';
import { LocalePlugin } from '@bw-ui/datepicker-locale';
import '@bw-ui/datepicker/css';
import '@bw-ui/datepicker-theming/css';

const date = ref(null);
const plugins = [ThemingPlugin, LocalePlugin];
const pluginOptions = {
  theming: { theme: 'dark' },
  locale: { locale: 'hi-IN' },
};
</script>

<template>
  <BWDatePicker
    v-model="date"
    :plugins="plugins"
    :plugin-options="pluginOptions"
  />
</template>

{% endraw %}

Available Plugins

| Plugin | Key | Options | | --------------------- | --------------- | ---------------------------------------- | | ThemingPlugin | theming | { theme: 'dark' \| 'light' \| 'auto' } | | LocalePlugin | locale | { locale: 'hi-IN' } | | AccessibilityPlugin | accessibility | { announceChanges: true } | | MobilePlugin | mobile | { enableSwipe: true } | | PositioningPlugin | positioning | { placement: 'bottom' } | | InputHandlerPlugin | input-handler | { format: 'DD/MM/YYYY' } | | DateUtilsPlugin | date-utils | {} |

⚙️ Props

Value & Events

<BWDatePicker
  v-model="date"
  :default-value="new Date()"
  @change="(date, data) => {}"
  @open="() => {}"
  @close="() => {}"
  @month-change="({ month }) => {}"
  @year-change="({ year }) => {}"
/>

Core Options

<BWDatePicker
  mode="popup"
  format="YYYY-MM-DD"
  placeholder="Select date"
  :disabled="false"
  :read-only="false"
/>

Date Constraints

<BWDatePicker
  :min-date="new Date()"
  :max-date="new Date('2025-12-31')"
  :disabled-dates="[date1, date2]"
/>

Display Options

<BWDatePicker
  :first-day-of-week="1"
  :show-week-numbers="false"
  :show-other-months="true"
  :number-of-months="1"
/>

Styling

{% raw %}

<BWDatePicker
  container-class="my-container"
  input-class-name="my-input"
  :container-style="{ width: '300px' }"
  :input-style="{ padding: '10px' }"
/>

{% endraw %}

🛠️ Template Ref Methods

<script setup>
import { ref } from 'vue';
import { BWDatePicker } from '@bw-ui/datepicker-vue';

const pickerRef = ref(null);
</script>

<template>
  <BWDatePicker ref="pickerRef" />
  <button @click="pickerRef?.open()">Open</button>
  <button @click="pickerRef?.close()">Close</button>
  <button @click="pickerRef?.clear()">Clear</button>
  <button @click="pickerRef?.today()">Today</button>
  <button @click="pickerRef?.setDate(new Date())">Set</button>
</template>

All Methods

| Method | Description | | ----------------- | ------------------- | | open() | Open picker | | close() | Close picker | | toggle() | Toggle open/close | | clear() | Clear selection | | setDate(date) | Set date | | getDate() | Get current date | | prevMonth() | Previous month | | nextMonth() | Next month | | prevYear() | Previous year | | nextYear() | Next year | | today() | Go to today | | getPlugin(name) | Get plugin instance | | getInstance() | Get core instance |

🎣 Composable API

{% raw %}

<script setup>
import { useBWDatePicker } from '@bw-ui/datepicker-vue';
import { ThemingPlugin } from '@bw-ui/datepicker-theming';

const {
  inputRef,     // Attach to input
  date,         // Current date (reactive)
  isOpen,       // Open state (reactive)
  open,         // Open picker
  close,        // Close picker
  toggle,       // Toggle picker
  setDate,      // Set date
  clear,        // Clear date
  prevMonth,    // Previous month
  nextMonth,    // Next month
  today,        // Go to today
  getPlugin,    // Get plugin
  getInstance,  // Get core instance
} = useBWDatePicker({
  mode: 'popup',
  format: 'YYYY-MM-DD',
  defaultDate: new Date(),
  plugins: [ThemingPlugin],
  pluginOptions: { theming: { theme: 'dark' } },
  onChange: (date) => {},
  onOpen: () => {},
  onClose: () => {},
});
</script>

<template>
  <input ref="inputRef" />
</template>

{% endraw %}

📘 TypeScript

<script setup lang="ts">
import { ref } from 'vue';
import { BWDatePicker, type BWDatePickerExposed } from '@bw-ui/datepicker-vue';

const pickerRef = ref<BWDatePickerExposed | null>(null);
const date = ref<Date | null>(null);

const handleChange = (newDate: Date | null) => {
  console.log(newDate);
};
</script>

<template>
  <BWDatePicker ref="pickerRef" v-model="date" @change="handleChange" />
</template>

🔄 SSR / Nuxt

Works automatically. The core is dynamically imported on client side.

<!-- No special configuration needed -->
<script setup>
import { BWDatePicker } from '@bw-ui/datepicker-vue';
</script>

📄 License

MIT © BW UI