<div class='sourceset sourceset-common'>Common</div>

```kotlin
object DatePickerDefaults
```

Contains default values used by the [DatePicker](/jetpack-compose/androidx.compose.material3/material3/components/DatePicker).

## Properties

<div class='sourceset sourceset-common'>Common</div>

```kotlin
val YearRange: IntRange
```

The range of years for the date picker dialogs.

<div class='sourceset sourceset-common'>Common</div>

```kotlin
val TonalElevation: Dp
```

The default tonal elevation used for [DatePickerDialog](/jetpack-compose/androidx.compose.material3/material3/components/DatePickerDialog).

<div class='sourceset sourceset-common'>Common</div>

```kotlin
val shape: Shape
```

The default shape for date picker dialogs.

<div class='sourceset sourceset-common'>Common</div>

```kotlin
val AllDates: SelectableDates
```

A default [SelectableDates](/jetpack-compose/androidx.compose.material3/material3/interfaces/SelectableDates) that allows all dates to be selected.

<div class='sourceset sourceset-common'>Common</div>

```kotlin
const val YearMonthSkeleton: String
```

A date format skeleton used to format the date picker's year selection menu button (e.g.
"March 2021")

<div class='sourceset sourceset-common'>Common</div>

```kotlin
const val YearAbbrMonthDaySkeleton: String
```

A date format skeleton used to format a selected date (e.g. "Mar 27, 2021")

<div class='sourceset sourceset-common'>Common</div>

```kotlin
const val YearMonthWeekdayDaySkeleton: String
```

A date format skeleton used to format a selected date to be used as content description for
screen readers (e.g. "Saturday, March 27, 2021")

## Functions

```kotlin
@Composable fun colors() = MaterialTheme.colorScheme.defaultDatePickerColors
```

Creates a [DatePickerColors](/jetpack-compose/androidx.compose.material3/material3/classes/DatePickerColors) that will potentially animate between the provided colors
according to the Material specification.

<h2 id="colors-containercolor-titlecontentcolor-headlinecontentcolor-weekdaycontentcolor-subheadcontentcolor-navigationcontentcolor-yearcontentcolor-disabledyearcontentcolor-currentyearcontentcolor-selectedyearcontentcolor-disabledselectedyearcontentcolor-selectedyearcontainercolor-disabledselectedyearcontainercolor-daycontentcolor-disableddaycontentcolor-selecteddaycontentcolor-disabledselecteddaycontentcolor-selecteddaycontainercolor-disabledselecteddaycontainercolor-todaycontentcolor-todaydatebordercolor-dayinselectionrangecontentcolor-dayinselectionrangecontainercolor-dividercolor-datetextfieldcolors">colors</h2>

```kotlin
@Composable
    fun colors(
        containerColor: Color = Color.Unspecified,
        titleContentColor: Color = Color.Unspecified,
        headlineContentColor: Color = Color.Unspecified,
        weekdayContentColor: Color = Color.Unspecified,
        subheadContentColor: Color = Color.Unspecified,
        navigationContentColor: Color = Color.Unspecified,
        yearContentColor: Color = Color.Unspecified,
        disabledYearContentColor: Color = Color.Unspecified,
        currentYearContentColor: Color = Color.Unspecified,
        selectedYearContentColor: Color = Color.Unspecified,
        disabledSelectedYearContentColor: Color = Color.Unspecified,
        selectedYearContainerColor: Color = Color.Unspecified,
        disabledSelectedYearContainerColor: Color = Color.Unspecified,
        dayContentColor: Color = Color.Unspecified,
        disabledDayContentColor: Color = Color.Unspecified,
        selectedDayContentColor: Color = Color.Unspecified,
        disabledSelectedDayContentColor: Color = Color.Unspecified,
        selectedDayContainerColor: Color = Color.Unspecified,
        disabledSelectedDayContainerColor: Color = Color.Unspecified,
        todayContentColor: Color = Color.Unspecified,
        todayDateBorderColor: Color = Color.Unspecified,
        dayInSelectionRangeContentColor: Color = Color.Unspecified,
        dayInSelectionRangeContainerColor: Color = Color.Unspecified,
        dividerColor: Color = Color.Unspecified,
        dateTextFieldColors: TextFieldColors? = null,
    ): DatePickerColors
```

Creates a [DatePickerColors](/jetpack-compose/androidx.compose.material3/material3/classes/DatePickerColors) that will potentially animate between the provided colors
according to the Material specification.

#### Parameters

| | |
| --- | --- |
| containerColor | the color used for the date picker's background |
| titleContentColor | the color used for the date picker's title |
| headlineContentColor | the color used for the date picker's headline |
| weekdayContentColor | the color used for the weekday letters |
| subheadContentColor | the color used for the month and year subhead labels that appear when months are displayed at a `DateRangePicker`. |
| navigationContentColor | the content color used for the year selection menu button and the months arrow navigation when displayed at a `DatePicker`. |
| yearContentColor | the color used for a year item content |
| disabledYearContentColor | the color used for a disabled year item content |
| currentYearContentColor | the color used for the current year content when selecting a year |
| selectedYearContentColor | the color used for a selected year item content |
| disabledSelectedYearContentColor | the color used for a disabled selected year item content |
| selectedYearContainerColor | the color used for a selected year item container |
| disabledSelectedYearContainerColor | the color used for a disabled selected year item container |
| dayContentColor | the color used for days content |
| disabledDayContentColor | the color used for disabled days content |
| selectedDayContentColor | the color used for selected days content |
| disabledSelectedDayContentColor | the color used for disabled selected days content |
| selectedDayContainerColor | the color used for a selected day container |
| disabledSelectedDayContainerColor | the color used for a disabled selected day container |
| todayContentColor | the color used for the day that marks the current date |
| todayDateBorderColor | the color used for the border of the day that marks the current date |
| dayInSelectionRangeContentColor | the content color used for days that are within a date range selection |
| dayInSelectionRangeContainerColor | the container color used for days that are within a date range selection |
| dividerColor | the color used for the dividers used at the date pickers |
| dateTextFieldColors | the [TextFieldColors](/jetpack-compose/androidx.compose.material3/material3/classes/TextFieldColors) defaults for the date text field when in `DisplayMode.Input`. See [OutlinedTextFieldDefaults.colors](/jetpack-compose/androidx.compose.material3/material3/objects/OutlinedTextFieldDefaults). |

<hr class="docs-overload-divider">

<h2 id="dateformatter-yearselectionskeleton-selecteddateskeleton-selecteddatedescriptionskeleton">dateFormatter</h2>

```kotlin
fun dateFormatter(
        yearSelectionSkeleton: String = YearMonthSkeleton,
        selectedDateSkeleton: String = YearAbbrMonthDaySkeleton,
        selectedDateDescriptionSkeleton: String = YearMonthWeekdayDaySkeleton,
    ): DatePickerFormatter
```

Returns a [DatePickerFormatter](/jetpack-compose/androidx.compose.material3/material3/interfaces/DatePickerFormatter).

The date formatter will apply the best possible localized form of the given skeleton and
Locale. A skeleton is similar to, and uses the same format characters as, a Unicode <a
href="http://www.unicode.org/reports/tr35/#Date_Format_Patterns">UTS #35</a> pattern.

One difference is that order is irrelevant. For example, "MMMMd" will return "MMMM d" in the
`en_US` locale, but "d. MMMM" in the `de_CH` locale.

#### Parameters

| | |
| --- | --- |
| yearSelectionSkeleton | a date format skeleton used to format the date picker's year selection menu button (e.g. "March 2021"). |
| selectedDateSkeleton | a date format skeleton used to format a selected date (e.g. "Mar 27, 2021") |
| selectedDateDescriptionSkeleton | a date format skeleton used to format a selected date to be used as content description for screen readers (e.g. "Saturday, March 27, 2021") |

<hr class="docs-overload-divider">

<h2 id="datepickertitle-displaymode-modifier-contentcolor">DatePickerTitle</h2>

```kotlin
@Composable
    fun DatePickerTitle(
        displayMode: DisplayMode,
        modifier: Modifier = Modifier,
        contentColor: Color = colors().titleContentColor,
    )
```

A default date picker title composable.

#### Parameters

| | |
| --- | --- |
| displayMode | the current [DisplayMode](/jetpack-compose/androidx.compose.material3/material3/classes/DisplayMode) |
| modifier | a [Modifier](/jetpack-compose/androidx.compose.ui/ui/interfaces/Modifier) to be applied for the title |
| contentColor | the content color of this title |

<hr class="docs-overload-divider">

<h2 id="datepickerheadline-displaymode-dateformatter-modifier-contentcolor">DatePickerHeadline</h2>

```kotlin
@Composable
    fun DatePickerHeadline(
        @Suppress("AutoBoxing") selectedDateMillis: Long?,
        displayMode: DisplayMode,
        dateFormatter: DatePickerFormatter,
        modifier: Modifier = Modifier,
        contentColor: Color = colors().headlineContentColor,
    )
```

A default date picker headline composable that displays a default headline text when there is
no date selection, and an actual date string when there is.

#### Parameters

| | |
| --- | --- |
| selectedDateMillis | a timestamp that represents the selected date _start_ of the day in _UTC_ milliseconds from the epoch |
| displayMode | the current [DisplayMode](/jetpack-compose/androidx.compose.material3/material3/classes/DisplayMode) |
| dateFormatter | a [DatePickerFormatter](/jetpack-compose/androidx.compose.material3/material3/interfaces/DatePickerFormatter) |
| modifier | a [Modifier](/jetpack-compose/androidx.compose.ui/ui/interfaces/Modifier) to be applied for the headline |
| contentColor | the content color of this headline |