Skip to content

Date range

Pick a period for a report: presets for the common ranges and two dates for anything else.

CSS + mian.js JSON Markdown Registry item

Report period

to

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/date-range.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-daterangeThe control. Add data-mn-daterange.
data-mn-rangeOn a preset button: the number of days, ending today.
mn-daterange-customThe two date inputs.

Accessibility

  • Presets are toggle buttons (aria-pressed) in a labelled group.
  • Both dates are native date inputs with their own labels, so they work with any keyboard and locale.
  • Listen for mn:change; detail has from, to and days.
Choose a noodle

Minimal

Flat

Pixel

Linear

Thin

Glass

Textured

Bold

Elegant

Rounded

On this page