DateRangePickerDay API
Demos
For examples and details on the usage of this React component, visit the component demo pages:
Import
import DateRangePickerDay from '/packages/x-date-pickers-pro/src/DateRangePickerDay';
// or
import { DateRangePickerDay } from '/packages/x-date-pickers-pro/src';
Props
If true
, day is the first visible cell of the month. Either the first day of the month or the first day of the week depending on showDaysOutsideCurrentMonth
.
Type:
bool
If true
, day is the last visible cell of the month. Either the last day of the month or the last day of the week depending on showDaysOutsideCurrentMonth
.
Type:
bool
Set to true
if the day
is the start of a highlighted date range.
Type:
bool
A ref for imperative actions. It currently only supports focusVisible()
action.
Type:
func | { current?: { focusVisible: func } }
If true
, the ripples are centered. They won't start at the cursor interaction position.
Type:
bool
Override or extend the styles applied to the component.
See CSS API below for more details.
Type:
object
If true
, days are rendering without margin. Useful for displaying linked range of days.
Type:
bool
If true
, the ripple effect is disabled.
⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure to highlight the element by applying separate styles with the .Mui-focusVisible
class.
Type:
bool
This prop can help identify which element has keyboard focus. The class name will be applied when the element gains the focus through keyboard interaction. It's a polyfill for the CSS :focus-visible selector. The rationale for using this feature is explained here. A polyfill can be used to apply a focus-visible
class to other components if needed.
Type:
string
Callback fired when the component is focused with a keyboard. We trigger a onFocus
callback too.
Type:
func
If true
, days outside the current month are rendered:
- if fixedWeekNumber
is defined, renders days to have the weeks requested.
- if fixedWeekNumber
is not defined, renders day to fill the first and last week of the current month.
- ignored if calendars
equals more than 1
on range pickers.
Type:
bool
The system prop that allows defining system overrides as well as additional CSS styles.
See the `sx` page for more details.
Type:
Array<func | object | bool> | func | object
ref
is forwarded to the root element.CSS
The following class names are useful for styling with CSS (the state classes are marked).
To learn more, visit the component customization page.
Styles applied to the root element if isHighlighting=true
.
Styles applied to the root element if isStartOfHighlighting=true
.
Styles applied to the root element if isEndOfHighlighting=true
.
Styles applied to the preview element.
Styles applied to the root element if isPreviewing=true
.
Styles applied to the root element if isStartOfPreviewing=true
.
Styles applied to the root element if isEndOfPreviewing=true
.
Styles applied to the root element if `outsideCurrentMonth=true`
Styles applied to the root element if day
is the start of the month.
Styles applied to the root element if day
is the end of the month.
Styles applied to the root element if day
is the first visible cell of the month.
Styles applied to the root element if day
is the last visible cell of the month.
Styles applied to the root element if it is an empty cell used to fill the week.
Styles applied to the day element if isHighlighting=false
.
Styles applied to the day element if selected=false
and isHighlighting=true
.
You can override the style of the component using one of these customization options:
- With a global class name.
- With a rule name as part of the component's
styleOverrides
property in a custom theme.