@molecule/app-mini-calendar-vue

Feature · mini-calendar · App (browser) · v1.1.2 · Apache-2.0

Month-view calendar with day selection and prev/next navigation

npm install @molecule/app-mini-calendar-vue

npm · Source on GitHub

How it works

@molecule/app-mini-calendar-vue is a ready-made mini-calendar feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.

import { createApp, defineComponent, h, ref } from 'vue'
import { MiniCalendar } from '@molecule/app-mini-calendar-vue'

const App = defineComponent({
  setup() {
    const selected = ref(new Date(2026, 5, 15))
    return () =>
      h(MiniCalendar, {
        selected: selected.value,
        onSelect: (date: Date) => {
          selected.value = date
          console.log(date.toISOString())
        },
        locale: 'en-US',
      })
  },
})

createApp(App).mount('#app')

Works with: @molecule/app-ui, @molecule/app-ui-vue, @molecule/app-vue

Reference

Vue mini month-view calendar.

Exports <MiniCalendar> — compact day picker with prev/next navigation, Intl-localized weekday + month names, controlled-optional selected + month props, and an isDisabled day predicate. It is the Vue counterpart of @molecule/app-mini-calendar-react: same props (React names), same DOM for the same input, same ClassMap tokens and the same callbacks.

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

Quick Start

import { createApp, defineComponent, h, ref } from 'vue'
import { MiniCalendar } from '@molecule/app-mini-calendar-vue'

const App = defineComponent({
  setup() {
    const selected = ref(new Date(2026, 5, 15))
    return () =>
      h(MiniCalendar, {
        selected: selected.value,
        onSelect: (date: Date) => {
          selected.value = date
          console.log(date.toISOString())
        },
        locale: 'en-US',
      })
  },
})

createApp(App).mount('#app')

Type

feature

Installation

npm install @molecule/app-mini-calendar-vue @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue

API

Interfaces

MiniCalendarProps

Props for MiniCalendar — the same props (React names) as @molecule/app-mini-calendar-react.

interface MiniCalendarProps {
  /** Controlled selected date (ISO yyyy-mm-dd or Date). */
  selected?: Date | string
  /** Called when the user picks a day. */
  onSelect?: (date: Date) => void
  /** Controlled visible month. If omitted the component tracks its own. */
  month?: Date
  /** Called when the user navigates months. */
  onMonthChange?: (date: Date) => void
  /**
   * Locale for weekday + month name formatting. Defaults to the app's active
   * locale, which follows a locale switch; an explicit `locale` still wins.
   */
  locale?: string
  /** Optional day-disabled predicate. */
  isDisabled?: (date: Date) => boolean
  /** Extra classes. */
  className?: string
}

Constants

MiniCalendar

Compact month-view calendar. Supports controlled selected + month props or runs uncontrolled. Weekday / month names come from Intl.DateTimeFormat in the locale prop, or the app's active locale when it is omitted. The prev/next buttons' aria-labels go through t() (miniCalendar.aria.*, English defaultValues).

const MiniCalendar: DefineComponent<
  ExtractPropTypes<{
    selected: PropType<Date | string>
    onSelect: PropType<(date: Date) => void>
    month: PropType<Date>
    onMonthChange: PropType<(date: Date) => void>
    locale: StringConstructor
    isDisabled: PropType<(date: Date) => boolean>
    className: StringConstructor
  }>,
  () => VNode,
  {},
  {},
  {},
  ComponentOptionsMixin,
  ComponentOptionsMixin,
  {},
  string,
  PublicProps,
  Readonly<
    ExtractPropTypes<{
      selected: PropType<Date | string>
      onSelect: PropType<(date: Date) => void>
      month: PropType<Date>
      onMonthChange: PropType<(date: Date) => void>
      locale: StringConstructor
      isDisabled: PropType<(date: Date) => boolean>
      className: StringConstructor
    }>
  > &
    Readonly<{}>,
  {},
  {},
  {},
  {},
  string,
  ComponentProvideOptions,
  true,
  {},
  any
>

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-vue ^1.1.0
  • @molecule/app-vue ^3.5.0 || ^4.0.0
  • vue ^3.4.0

Runtime Dependencies

  • @molecule/app-ui
  • @molecule/app-ui-vue
  • @molecule/app-vue
  • vue

Requires a wired ClassMap bond (setClassMap(...) at startup) — getClassMap() throws before wiring, and the prev/next buttons come from @molecule/app-ui-vue.

Weekday and month names come from Intl.DateTimeFormat(locale) — an explicit locale prop wins, otherwise the app's active locale, so they follow a locale switch. The prev/next buttons' aria-labels go through t() (miniCalendar.aria.previousMonth / miniCalendar.aria.nextMonth, English defaultValues); translations live in the @molecule/app-locales-mini-calendar bond.

When month is supplied the visible month is fully controlled — wire onMonthChange too or the arrows will appear dead. The grid always renders 6 weeks; days outside the visible month render dimmed and remain clickable unless isDisabled filters them.

Translations

Translation strings are provided by @molecule/app-locales-mini-calendar.