Data input

Time Picker

The native time field styled as an Input, with steady digits, a clear active segment and an optional click-to-open picker.

Class nameTypeDescription
inputplf:inputComponentA native time input
fieldplf:fieldComponentA label, the input and its messages
field-labelplf:field-labelPartThe input's label
field-requiredplf:field-requiredPartMarks a required field in the label
field-helpplf:field-helpPartHelp text
field-errorplf:field-errorPartAn error message
input-smplf:input-smSizeSmall
input-lgplf:input-lgSizeLarge

Default

The value is always submitted as 24-hour HH:MM, whatever the display.

Always submitted as 24-hour HH:MM.

Bounds and steps

Write min, max and value as HH:MM, and step in seconds.

Between 08:00 and 18:00, in 15-minute steps.

A step below 60 seconds adds a seconds segment.

States and direction

In dir="rtl" the label and help follow the direction, but the browser keeps its own segment order.

Choose a time after 08:00.

Set by the venue.

Unavailable for this booking.

يتبع الحقل اتجاه القراءة.

JavaScript

Click to open needs JavaScript; the field itself needs none. The Full script (pelatform-ui.min.js) starts every component on page load, with no code of your own; with ESM imports, call init() yourself, as in Installation. For markup you add later, see Dynamic content.

<link rel="stylesheet" href="pelatform-ui.min.css">
<script src="pelatform-ui.min.js" defer></script>
<link rel="stylesheet" href="pelatform-ui.prefixed.min.css">
<script src="pelatform-ui.min.js" defer></script>
Attribute Purpose
data-plf-time-picker On a native <input type="time">: a pointer click opens the browser’s picker; keyboard focus does not, and read-only or disabled fields stay closed
Method Behavior
PLF.TimePicker.getOrCreateInstance(input) Returns the instance, creating it for a time input
PLF.TimePicker.getInstance(input) Returns the instance or null
instance.destroy() Removes the click listener

TimePicker fires no events of its own; listen to the native input and change events. The browser handles the keyboard.

React

TimePicker from @pelatform/react renders the native time input, whose picker a click opens as the script’s does; inside a Field it takes the field’s label, help and error.

Prop Values Default
size sm, lg The default size

The other props are a native input’s, className and ref included.

CSS variables

Time Picker uses the Input variables; these set its height and active segment.

Variable Default
--plf-input-height 2.25rem (36px); 2rem (32px) with input-sm, 2.5rem (40px) with input-lg
--plf-color-primary-border --plf-color-primary at 40% on the surface; fills the active hour, minute or second segment in Chromium and WebKit

Built with Pelatform UIv0.1.0

Components

Getting started

Foundations

Components

Actions

Data display

Navigation

Feedback

Data input

Layout

Advanced

Integrations

Blocks

Application

Authentication

Icons