DateRangePickerDay API
想要学习更多组件属性和 CSS API,可以查阅 React DateRangePickerDay 组件的 API 文档。
导入
import DateRangePickerDay from '@mui/lab/DateRangePickerDay';
// 或
import { DateRangePickerDay } from '@mui/lab';组件名称
The nameMuiDateRangePickerDay can be used when providing default props or style overrides in the theme.属性
| 名称 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| day* | any | The date to show. | |
| isEndOfHighlighting* | bool | false | Set to true if the day is the end of a highlighted date range. |
| isEndOfPreviewing* | bool | false | Set to true if the day is the start of a highlighted date range. |
| isHighlighting* | bool | false | Set to true if the day is in a highlighted date range. |
| isPreviewing* | bool | false | Set to true if the day is in a preview date range. |
| isStartOfHighlighting* | bool | false | Set to true if the day is the start of a highlighted date range. |
| isStartOfPreviewing* | bool | false | Set to true if the day is the end of a highlighted date range. |
| outsideCurrentMonth* | bool | false | If true, day is outside of month and will be hidden. |
| children | node | The content of the component. | |
| classes | object | Override or extend the styles applied to the component. See CSS API below for more details. | |
| selected | bool | false | If true, renders as selected. |
| sx | Array<func | object | bool> | func | object | The system prop that allows defining system overrides as well as additional CSS styles. See the `sx` page for more details. |
ref 则会被传递到根元素中。CSS
| 规则名称 | 全局类名 | 描述 |
|---|---|---|
| root | .MuiDateRangePickerDay-root | Styles applied to the root element. |
| rangeIntervalDayHighlight | .MuiDateRangePickerDay-rangeIntervalDayHighlight | Styles applied to the root element if isHighlighting=true and outsideCurrentMonth=false. |
| rangeIntervalDayHighlightStart | .MuiDateRangePickerDay-rangeIntervalDayHighlightStart | Styles applied to the root element if isStartOfHighlighting=true or day is the start of the month. |
| rangeIntervalDayHighlightEnd | .MuiDateRangePickerDay-rangeIntervalDayHighlightEnd | Styles applied to the root element if isEndOfHighlighting=true or day is the end of the month. |
| rangeIntervalPreview | .MuiDateRangePickerDay-rangeIntervalPreview | Styles applied to the preview element. |
| rangeIntervalDayPreview | .MuiDateRangePickerDay-rangeIntervalDayPreview | Styles applied to the root element if isPreviewing=true and outsideCurrentMonth=false. |
| rangeIntervalDayPreviewStart | .MuiDateRangePickerDay-rangeIntervalDayPreviewStart | Styles applied to the root element if isStartOfPreviewing=true or day is the start of the month. |
| rangeIntervalDayPreviewEnd | .MuiDateRangePickerDay-rangeIntervalDayPreviewEnd | Styles applied to the root element if isEndOfPreviewing=true or day is the end of the month. |
| day | .MuiDateRangePickerDay-day | Styles applied to the day element. |
| dayOutsideRangeInterval | .MuiDateRangePickerDay-dayOutsideRangeInterval | Styles applied to the day element if isHighlighting=false. |
| dayInsideRangeInterval | .MuiDateRangePickerDay-dayInsideRangeInterval | Styles applied to the day element if selected=false and isHighlighting=true. |
| notSelectedDate | .MuiDateRangePickerDay-notSelectedDate | Styles applied to the day element if selected=false. |
您可以使用组件自定义选项对组件进行个性化:
- With a global class name.
- With a rule name as part of the component's
styleOverridesproperty in a custom theme.