Skip to content

Search Feitio

↵ opens the first↑↓ chooseEsc closes

TimeInput

A time in a single box: hour and minute and, in the 12-hour format, AM or PM. The format belongs to the product, not to the user’s system.

On this page

Playground

When to remind?
Clock
State
Background
HTML
<fieldset class="feitio-fieldset"><legend class="feitio-label">When to remind?</legend><div class="feitio-time-field" data-hour-cycle="24"><input class="seg" inputmode="numeric" maxlength="2" value="19" aria-label="Hour"><span class="sep" aria-hidden="true">:</span><input class="seg" inputmode="numeric" maxlength="2" value="30" aria-label="Minute"></div></fieldset>

When to use

When not to use

Examples

When to remind?

24 or 12 hours

The format comes from the data-hour-cycle attribute. In the 12-hour one, AM/PM sits inside the box, and a tap switches it.

Show code
HTML
<fieldset class="feitio-fieldset">
  <legend class="feitio-label">Quando lembrar?</legend>
  <div class="feitio-time-field" data-hour-cycle="24">
    <input class="seg" inputmode="numeric" maxlength="2" aria-label="Hora">
    <span class="sep" aria-hidden="true">:</span>
    <input class="seg" inputmode="numeric" maxlength="2" aria-label="Minuto">
    <button type="button" class="period" aria-label="AM ou PM">AM</button>
  </div>
</fieldset>

Anatomy

  1. Hour: two digits.
  2. Minute: two digits, after the colon.
  3. AM or PM: only in the 12-hour format; a tap switches it.

States

Empty
Filled, 24h
Filled, 12h
Error in the minute
Use a minute between 00 and 59

Accessibility

Attributes

AttributeValuesWhat for
class="feitio-time-field"requiredThe box with its parts.
data-hour-cycle"24", "12"The format, chosen by the product.
class="seg"hour and minuteWith inputmode="numeric" and maxlength="2".
class="period"the AM/PM buttonOnly shows in the 12-hour format.
aria-invalid="true"only on the wrong partMarks only the hour or only the minute.
Top