vn/ui / Docs / Components

Lunar Date Picker

Convert calendar dates in Vietnam time.

Preview

1 / 1 / 2026 Lunar

The Code tab uses the common @/* alias. Import the copied file from the directory in vnui.json if your app uses a different path.

Installation

Initialize vn/ui in your app, then add this component.

npx @naminc/vnui@latest add lunar-date-picker

Usage and variants

Civil dates use UTC+7. The local table spans 1976–2099 and distinguishes leap months. Import gregorianToLunar and lunarToGregorian from the installed lib/lunar module for bidirectional conversion.

<LunarDatePicker min="2026-01-01" max="2026-12-31" defaultValue="2026-02-17" />

API

PropTypeBehavior
value, defaultValuestringControlled value or initial uncontrolled value.
onValueChange(value) => voidReceives the next value; connect it to form state or React Hook Form Controller.
label, name, disabled, classNamestring, string, boolean, stringVisible label, form name, disabled state and CSS class.
valuestringGregorian date, YYYY-MM-DD.
min, maxstringInclusive ISO date bounds within 1976–2099.

Use value and onValueChange for controlled fields, including React Hook Form Controller. Use defaultValue for standalone fields. label, name, disabled and className customize the field.

Accessibility

Fields have visible labels and keyboard focus. Searchable selectors support typing, arrow keys, Enter and Escape; date controls use browser keyboard behavior.

An out-of-range date sets aria-invalid and explains the allowed range. The lunar editor reports invalid day or leap-month combinations inline.