HomeGetting StartedColor SystemTypographySpacingIconographyLayoutInstallationUsageAngularBlazorReactSvelteVueThemingTypographyCustomizationCSS-Only ComponentsFormsIconsIllustrationsAccessibilityGlobal ConfigurationTailwind CSSSass LibraryForge MCP ServerDropdown OptionsFocus Indicator ClippingAll componentsButtonButton AreaChipFloating Action ButtonIcon ButtonSplit ButtonAutocompleteButton ToggleCalendarCheckboxChip FieldColor PickerDate PickerDate Range PickerFile PickerLabelRadioSelectSliderSwitchText FieldTime PickerApp BarApp LauncherDrawerMenuPaginatorSkip LinkStepperTabsView SwitcherAccordionApp LayoutCardDividerExpansion PanelScaffoldSplit ViewStackStructured CardToolbarBadgeBannerBusy IndicatorCircular ProgressDialogInline MessageLinear ProgressPage StateSkeletonToastTooltipAvatarIconKeyLabel ValueListMeterSecretTableTimelineTimestampTreeKeyboard ShortcutPopoverIntroductionColorTypographySpacingShapeBorderElevationLayeringAnimationUsageIcon LibraryBlocksRoadmapChangelogBlog

Time Picker

A time input component with an integrated dropdown for selecting time values, with support for various formats, masking, and validation.

Overview

Time pickers allow users to select specific time values through an interactive interface. They provide a structured way to input time data while reducing errors and ensuring consistent formatting across different time systems and locales.

Usage

forge-time-picker wraps a child text field and adds a dropdown of selectable time options, through use24HourTime, min/max/step, restrictedTimes, masked, and allowInput. Use it when a person is entering a specific time; for a time range, place two time pickers side by side. Reach for a select instead when the choice is really a vague description (“now”, “in 30 minutes”) rather than a specific time, or a plain text field instead when the value isn’t a time at all.

Rules

Do
Support both 12-hour and 24-hour formats depending on locale and context.Pair a 12-hour format with a visible AM/PM indicator.Place two time pickers side by side to capture a time range.Show a timezone alongside the value when the time is specific to a place or event.
Don't
Don't use a time picker for vague time descriptions like "now" or "in an hour" — use a select instead.Don't use a time picker for free-text entry that isn't actually a time — use a text field instead.Don't restrict input to the dropdown alone unless typing a time would be error-prone for your data.

Basic usage

A time picker’s text field accepts typed input and its trailing icon button opens a dropdown of selectable times.

A time picker combining a text field with a dropdown of time options.

Format

Set use24HourTime to switch between the default 12-hour format and 24-hour time.

12-hour (default) and 24-hour formats.

Working with values

Always use 24-hour format in code

Regardless of the display format shown to the user, every programmatic read or write of value — and the change event — uses 24-hour time (e.g. "15:30"). This keeps the format locale-independent. Set values through forge-time-picker itself, never the wrapped <input> (the input only takes cosmetic attributes like placeholder). If the field needs to be required or invalid, set that on the embedded forge-text-field, not on forge-time-picker.

const picker = document.querySelector("forge-time-picker");
picker.value = "15:30"; // always 24-hour, even if use24HourTime is false
picker.addEventListener("change", () => console.log(picker.value)); // also 24-hour

Now and hour shortcuts

Set showNow and showHourOptions to add shortcuts for the current time and whole-hour options to the dropdown.

Shortcuts for the current time and whole-hour options.

Constraints

Set min, max, and step to bound selectable times and control the interval between dropdown options.

A time picker bounded to a range, in 30-minute steps.

Masking and input

Set masked to apply an input mask, shown as a placeholder, so typed times are corrected to a consistent format as the user types.

A masked time picker showing its format as a placeholder.

Disabled

Set disabled to prevent typing or opening the dropdown.

A disabled time picker.

A time input component with integrated dropdown for selecting time values with support for various formats, masking, and validation options.

import "@tylertech/forge/time-picker";
Properties
PropertyAttributeTypeDefaultDescription
valuevaluestring | null | undefinedundefinedThe current value of the time picker.
openopenbooleanfalseWhether or not the time picker is open.
allowSecondsallow-secondsbooleanfalseWhether or not to allow seconds in the time picker.
maskedmaskedbooleanfalseWhether or not the time picker input should be masked.
showMaskFormatshow-mask-formatbooleanfalseWhether or not to show the mask format in the input.
use24HourTime—booleanfalseWhether or not to use 24-hour time.
allowInvalidTimeallow-invalid-timebooleanfalseWhether or not to allow invalid times.
minminstring | null | undefinedundefinedThe minimum time that can be selected.
maxmaxstring | null | undefinedundefinedThe maximum time that can be selected.
restrictedTimesrestricted-timesstring[][]An array of times that cannot be selected.
startTimestart-timestring | null | undefinedundefinedThe time to start the time picker at.
stepstepnumberundefinedThe step interval for the time picker.
allowInputallow-inputbooleanfalseWhether or not to allow manual input of the time.
showNowshow-nowbooleanfalseWhether or not to show a "Now" button.
showHourOptionsshow-hour-optionsbooleanfalseWhether or not to display hour options in dropdown.
customOptionscustom-optionsITimePickerOption[][]An array of custom time picker options.
validationCallbackvalidation-callbackTimePickerValidationCallbackundefinedA callback function to validate the time.
parseCallbackparse-callbackTimePickerParseCallbackundefinedA callback function to parse the time.
formatCallbackformat-callbackTimePickerFormatCallbackundefinedA callback function to format the time.
coercionCallbackcoercion-callbackTimePickerCoercionCallbackundefinedA callback function to coerce the time.
prepareMaskCallbackprepare-mask-callbackTimePickerPrepareMaskCallbackundefinedA callback function to prepare the mask.
disableddisabledbooleanfalseWhether or not the time picker is disabled.
popupClassespopup-classesstring | string[]undefinedThe classes to apply to the time picker popup.
allowDropdownallow-dropdownbooleanfalseWhether or not to allow the time picker to be a dropdown.
popupTargetpopup-targetstringundefinedThe target element to attach the popup to.
—use-24-hour-timebooleanfalseWhether or not to use 24-hour time.

Labeling

Add an aria-label to the <input> if you’re not pairing it with a <label for> — the time picker doesn’t infer one on its own.

Automatic ARIA attributes

The component applies role="combobox", aria-live, aria-atomic, aria-haspopup, aria-expanded, aria-controls, aria-activedescendant, and aria-disabled to the input for you, so you don’t need to set those yourself.

Keyboard interaction

As you arrow through the dropdown, the highlighted option is announced via aria-activedescendant.

Loading Forge chat…