@molecule/app-mini-calendar-solid

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-solid

npm · Source on GitHub

How it works

@molecule/app-mini-calendar-solid 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 { createSignal } from 'solid-js'
import { MiniCalendar } from '@molecule/app-mini-calendar-solid'

export function Calendar() {
  const [selected, setSelected] = createSignal<Date | undefined>(new Date(2026, 5, 15))

  return (
    <MiniCalendar
      selected={selected()}
      onSelect={(date) => {
        setSelected(date)
        console.log(date.toISOString())
      }}
      locale="en-US"
    />
  )
}

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

Reference

Solid 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 Solid 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 { createSignal } from 'solid-js'
import { MiniCalendar } from '@molecule/app-mini-calendar-solid'

export function Calendar() {
  const [selected, setSelected] = createSignal<Date | undefined>(new Date(2026, 5, 15))

  return (
    <MiniCalendar
      selected={selected()}
      onSelect={(date) => {
        setSelected(date)
        console.log(date.toISOString())
      }}
      locale="en-US"
    />
  )
}

Type

feature

Installation

npm install @molecule/app-mini-calendar-solid @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js

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
}

Functions

MiniCalendar(props)

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).

This is the Solid counterpart of @molecule/app-mini-calendar-react: the same props (React names), the same ClassMap tokens, and the same DOM for the same input.

function MiniCalendar(props: MiniCalendarProps): JSX.Element
  • props — Component props (see MiniCalendarProps).

Returns: The rendered calendar.

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-solid ^3.5.0 || ^4.0.0
  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-solid ^1.1.0
  • solid-js ^1.8.0

Runtime Dependencies

  • @molecule/app-solid
  • @molecule/app-ui
  • @molecule/app-ui-solid
  • solid-js

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

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.