Atoms - Circuit design system

in development

Date and Time Fields have not been defined for the Design System yet; however, general best practices for this element have already been outlined below.

Date and Time

Description

Date and time fields are input elements that enable users to select or enter specific dates, times, or both, depending on the context. These fields often include a calendar or time picker interface for easier selection, while also supporting manual input for flexibility.


Use Cases

Use date, time, or combined date-time fields for inputs such as:


Usage

Input Types:

Labels and Accessibility: Use clear, descriptive <label for="...">Text</label>. Make sure that screen readers are supported.

Data Format:

Time Format:

Date-Time Format: ISO 8601 (YYYY-MM-DDTHH:MM) for datetime-local

Time Zones: Auto-detect via browser/geolocation when possible. Display or allow manual selection with a dropdown if necessary. Indicate clearly near the input.

Defaults and Pre-Filled Values: Pre-fill logical defaults to improve speed and ease of use, such as Current date/time for scheduling, Business hours for appointments, Next available slot for bookings. Ensure defaults are easy to override.

Ranges and Validation: Use min and max attributes to restrict valid dates or times. For combined date-time inputs, dynamically adjust time availability based on selected date. Disable invalid or out-of-range options visually and functionally.

Calender & Pick UI:

Efficiency:

Keyboard Support: Ensure full keyboard accessibility. Tab should focus fields, arrow keys should be able to be used for navigation, enter should confirm selection. Allow full keyboard entry and auto-formatting of inputs if possible.