hh:mm aa
import { DemoContainer } from '@mui/x-date-pickers/internals/demo';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { TimeField } from '@mui/x-date-pickers/TimeField';
export default function BasicTimeField() {
return (
<LocalizationProvider dateAdapter={AdapterDayjs}>
<DemoContainer components={['TimeField']}>
<TimeField label="Basic time field" />
</DemoContainer>
</LocalizationProvider>
);
}
Uncontrolled vs. controlled value
The value of the component can be uncontrolled or controlled.
03:30 PM
03:30 PM
Localization
See the Date format and localization and Translated components documentation pages for more details.
Customize the time format
03:30 pm
15:30
15:30:00
Validation
See the Validation documentation page for more details.
API
See the documentation below for a complete reference to all of the props and classes available to the components mentioned here.