Stablev0.1.0date

TaiwanCalendarMonth

台灣月曆

完整月曆網格,含民國年標題、週末色調、國定假日標記(整合 TaiwanHolidayBadge)、前後月切換按鈕、完整鍵盤導覽支援。

Full month calendar grid with ROC year header, weekday labels, weekend tinting, holiday badges (via TaiwanHolidayBadge), prev/next navigation, and full keyboard support (arrow keys, Enter to select).

Installation

CLI

npx taiwan-ui add taiwan-calendar-month

npm package

npm install @taiwan-ui/react

Requires: components/taiwan/TaiwanHolidayBadge

Live Demo

Default view: Feb 2026 (春節 + 和平紀念日 visible). Click prev/next to navigate, click any date to select.

民國 115 年 · 2026

2 月

Props API

PropTypeDefault
year*number
month*number
valueDate | null
onSelect(date: Date) => void
onMonthChange(year: number, month: number) => void
showNavbooleantrue
englishbooleanfalse

Playground

Props

西元年

月份(0 = 一月)

顯示前後月按鈕

英文星期標題

Generated code
import TaiwanCalendarMonth from "@/components/taiwan/TaiwanCalendarMonth";

export default function Example() {
  return (
    <TaiwanCalendarMonth
  showNav={true}
/>
  );
}

Code Examples

import { useState } from "react";
import TaiwanCalendarMonth from "@/components/taiwan/TaiwanCalendarMonth";

export default function MonthView() {
  const [date, setDate] = useState<Date | null>(null);
  const [year, setYear] = useState(2026);
  const [month, setMonth] = useState(1); // February (0-indexed)

  return (
    <TaiwanCalendarMonth
      year={year}
      month={month}
      value={date}
      onSelect={setDate}
      onMonthChange={(y, m) => { setYear(y); setMonth(m); }}
    />
  );
}
月曆民國紀年假日標記鍵盤導覽

Related Components