Marigold
v18.0.0-beta.3
Marigold
v18.0.0-beta.3

Application

MarigoldProvider
RouterProvider

Layout

AppShellbeta
Aside
Aspect
Center
Columns
Container
Grid
Inline
Inset
Pagebeta
Panelbeta
Scrollable
Split
Stack
Tiles

Actions

Buttonupdated
ButtonGroupbeta
Link
LinkButton
ToggleButtonbeta

Form

Autocomplete
Calendar
Checkbox
ComboBox
DateField
DatePicker
DateRangePickerbeta
FileField
Form
NumberField
Radio
RangeCalendaralpha
SearchField
SegmentedControlbeta
Select
SelectListupdated
Slider
Switchupdated
TagFieldbeta
TextArea
TextField
TimeField

Collection

Cardupdated
Table
Tag
ActionBaralpha

Navigation

Accordion
Breadcrumbs
Pagination
Sidebarbeta
Tabs
TopNavigationbeta

Overlay

ActionMenualpha
ContextualHelp
Dialog
Drawer
Menuupdated
Toastbeta
Tooltip

Content

Badge
Descriptionalpha
Divider
EmptyStatebeta
Headline
Keyboardbeta
List
Loader
SectionMessage
SVG
Text
TextValuealpha
Titlealpha

Formatters

DateFormat
NumericFormat

Hooks and Utils

cn
cva
extendTheme
parseFormData
useAsyncListData
useLandmark
useListData
useResponsiveValueupdated
useTheme
VisuallyHidden
Components

TimeField

Component for entering time in forms.

The <TimeField> allows users to enter and edit time values using the keyboard. Each part of the time value, such as hour, minute, and optionally AM/PM, is displayed in an individually editable segment. These segments are focusable and can be incremented or decremented using the arrow keys, or edited by typing. This segmented approach ensures correct formatting and parsing of time values across different locales and hour cycles, and provides a reliable, keyboard-friendly way to input time.

Anatomy

A <TimeField> consists of a label and a group of segments representing each unit of a time, such as hours, minutes and seconds.

Anatomy of timefield

Appearance

The appearance of a component can be customized using the variant and size props. These props adjust the visual style and dimensions of the component, available values are based on the active theme.

The selected theme does not has any options for"variant" and "size".
Event time
⁦1:45⁩ PM
PropertyTypeDescription
variant-The available variants of this component.
size-The available sizes of this component.

Usage

The <TimeField> component is a flexible input element for selecting times within forms. It improves user experience by offering a clear and structured way to enter time values, minimizing errors from manual input. With support for labels, descriptions, and time formatting options like 12- or 24-hour cycles, it communicates its function effectively. The component also allows setting default values and customizing granularity (e.g., hours, minutes, seconds). This makes the <TimeField> ideal for applications that require accurate and accessible time selection.

Min/Max Values

The minValue and maxValue props are used to perform built-in validation. This prevents the user from choosing times outside the valid range.

Pick a time
⁦12:00⁩ PM
Time must be during office hours form 09:00 - 17:00
import { parseTime } from '@internationalized/date';import { TimeField, TimeFieldProps } from '@marigold/components';export default (props: TimeFieldProps) => (  <TimeField    minValue={parseTime('09:00')}    maxValue={parseTime('17:00')}    label="Pick a time"    description="Time must be during office hours form 09:00 - 17:00"    defaultValue={parseTime('12:00')}    {...props}  />);

Props

Did you know? You can explore, test, and customize props live in Marigold's storybook. Watch the effects they have in real-time!
View TimeField stories

TimeField

Prop

Type

Accessibility props (4)

Prop

Type

DOM event handlers (64)

Prop

Type

Related

Forms

How to structure, validate, and submit forms with Marigold.

Form Fields

Learn how to build forms.
Last update: 2 months ago

TextField

Component for input forms.

Card

Represents one item in a collection.

On this page

AnatomyAppearanceUsageMin/Max ValuesPropsTimeFieldRelated