Using Grommet for HPE?See DateInput examples and guidance.
The default date or date range value in ISO8601 format.
string
"2020-07-21T15"
array
[2020-07-31T15, 2020-07-31T15]
Any properties to pass on to the underlying Drop when not inline.
object
{ align: { top: "bottom", left: "left" } }
The date format to use. This property should be used when in a Form.
string
If not specified, the date value will not be displayed as a text string and the user will not be able to enter a date by typing. For example: 'mm/dd/yyyy', or for a range: 'mm/dd/yyyy-mm/dd/yyyy'. For a date without leading zeros: 'm/d/yyyy'.
"mm/dd/yyyy"
Whether the calendar should always be shown or via a Drop when interacting with the input.
boolean
true
false
Custom messages for DateInput. Used for accessibility by screen readers.
object
{ "enterCalendar": "Calendar is open, press tab to enter the calendar", "exitCalendar": "Exited calendar dialog" }
Function that will be called when the user types or selects a date. The updated value will be available via 'event.value'.
function
() => {}
Makes the DateInput readOnly and adds a copy to clipboard button. Setting this to true will automatically set the readOnly prop to true.
boolean
true
false
Whether the icon should be reversed so that the icon is at the beginning of the input.
boolean
true
false
The size of the text.
string
"xsmall"
"small"
"medium"
"large"
"xlarge"
"xxlarge"
"2xl"
"3xl"
"4xl"
"5xl"
"6xl"
"string"
At its core, the DateInput component is a regular <div> element. Thus, both DOM and React properties, methods, and events are accessible. To read up on all of the possible DOM attributes and types available for div elements, check out this MDN Web Documents page. To learn more about DOM events and methods, you can read more on the MDN Web Events documentation page.
Also, feel free to read about the types of React events available, or see how DOM attributes change in React. Working in tandem with Styled Components, you also have access to the as property.
Background style for readOnly inputs.
string
A color or image url.
"neutral-1"
"url(//my.com/assets/img.png)"
object
{ color: "neutral-1", dark: true, image: "url(//my.com/assets/img.png)" position: "bottom", opacity: true, repeat: "no-repeat", size: "cover", light: "string" }
where opacity could be:
"weak"
"medium"
"strong"
boolean
number
where position could be:
any CSS for background-position
where repeat could be:
"no-repeat"
"repeat"
"string"
where size could be:
"cover"
"contain"
"string"