Skip to content

Duration picker

Hours, minutes and seconds as three small fields that move on as you type.

CSS + mian.js JSON Markdown Registry item

Timer

Simmer for

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/duration-picker.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-durationThe group. Add data-mn-duration.
mn-duration-partOne field with its label under it.
data-unitOn each input: h, m or s.
mn-duration-sepThe colon between parts.

Accessibility

  • Each part is a labelled number input with its own range.
  • Put the group in a <fieldset> with a <legend> that says what the duration is for.
  • Typing two digits moves to the next part; arrow keys step the value.
  • Listen for mn:change; detail has seconds and text.
Choose a noodle

Minimal

Flat

Pixel

Linear

Thin

Glass

Textured

Bold

Elegant

Rounded

On this page