Skip to content

Calendar

A month grid for picking a date, on its own or in a popover as a date field. Full keyboard support and locale-aware names.

CSS + mian.js JSON Markdown Registry item

Calendar

Date field

An input with a calendar in a popover. Typing a date also works.

Date range

Check-in and check-out: the first choice starts the range, the second ends it. Hover previews it.

Installation

Everything ships in one stylesheet and one small script. There is nothing to import per component.

<link rel="stylesheet" href="https://mian.ro/dist/mian.css">
<script src="https://mian.ro/dist/mian.js" defer></script>

Prefer to own the files? /r/calendar.json is a registry item with this component's CSS and example markup, ready to copy into your project with any tool that reads the open registry-item format.

Class reference

Class / attributeDescription
mn-calendarThe calendar. mian.js renders the month grid inside it.
data-value="YYYY-MM-DD"Selected date.
data-min · data-maxEarliest and latest selectable date.
data-week-start="0–6"First day of the week (0 = Sunday, default 1 = Monday).
data-mn-for="#input"Keeps an input in sync; inside a [popover] the calendar closes after a choice.
data-rangePick a range. data-value="YYYY-MM-DD/YYYY-MM-DD"; data-mn-start / data-mn-end keep two inputs in sync; mn:change carries { start, end, nights }.

Accessibility

  • The grid is a table with role="grid", column headers with full weekday names (abbr) and a live month title.
  • Only one day is in the tab order. Arrow keys move by day and week, Page Up/Down by month (Shift: year), Home/End to the week’s edges, Enter or Space selects.
  • Each day button has a full date as its accessible name; today is aria-current="date", the chosen day aria-pressed="true".
  • Emits mn:change with { value } as YYYY-MM-DD.
Choose a noodle

Minimal

Flat

Pixel

Linear

Thin

Glass

Textured

Bold

Elegant

Rounded

On this page