# DatePickerDefaults

Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/DatePicker.kt+class:androidx.compose.material3.DatePickerDefaults) Common/AllAndroid/JVM
- Cmn

  ```
  object DatePickerDefaults
  ```

*** ** * ** ***

Contains default values used by the `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePicker.composable#DatePicker(androidx.compose.material3.DatePickerState,androidx.compose.ui.Modifier,androidx.compose.material3.DatePickerFormatter,androidx.compose.material3.DatePickerColors,kotlin.Function0,kotlin.Function0,kotlin.Boolean,androidx.compose.ui.focus.FocusRequester)`.

## Summary

| ### Constants |
|---|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerDefaults#YearAbbrMonthDaySkeleton()` A date format skeleton used to format a selected date (e.g. "Mar 27, 2021") | Cmn |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerDefaults#YearMonthSkeleton()` A date format skeleton used to format the date picker's year selection menu button (e.g. "March 2021") | Cmn |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerDefaults#YearMonthWeekdayDaySkeleton()` 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") | Cmn |

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerDefaults#DatePickerHeadline(kotlin.Long,androidx.compose.material3.DisplayMode,androidx.compose.material3.DatePickerFormatter,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Color)( selectedDateMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html?, displayMode: https://developer.android.com/reference/kotlin/androidx/compose/material3/DisplayMode, dateFormatter: https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerFormatter, modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier, contentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color )` 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. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerDefaults#DatePickerTitle(androidx.compose.material3.DisplayMode,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Color)( displayMode: https://developer.android.com/reference/kotlin/androidx/compose/material3/DisplayMode, modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier, contentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color )` A default date picker title composable. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerColors` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerDefaults#colors()()` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerColors` that will potentially animate between the provided colors according to the Material specification. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerColors` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerDefaults#colors(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.material3.TextFieldColors)( containerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, titleContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, headlineContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, weekdayContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, subheadContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, navigationContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, yearContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledYearContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, currentYearContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, selectedYearContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledSelectedYearContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, selectedYearContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledSelectedYearContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, dayContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledDayContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, selectedDayContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledSelectedDayContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, selectedDayContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledSelectedDayContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, todayContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, todayDateBorderColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, dayInSelectionRangeContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, dayInSelectionRangeContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, dividerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, dateTextFieldColors: https://developer.android.com/reference/kotlin/androidx/compose/material3/TextFieldColors? )` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerColors` that will potentially animate between the provided colors according to the Material specification. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerFormatter` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerDefaults#dateFormatter(kotlin.String,kotlin.String,kotlin.String)( yearSelectionSkeleton: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, selectedDateSkeleton: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, selectedDateDescriptionSkeleton: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html )` Returns a `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerFormatter`. | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/SelectableDates` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerDefaults#AllDates()` A default `https://developer.android.com/reference/kotlin/androidx/compose/material3/SelectableDates` that allows all dates to be selected. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerDefaults#TonalElevation()` The default tonal elevation used for `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerDialog.composable#DatePickerDialog(kotlin.Function0,kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Function0,androidx.compose.ui.graphics.Shape,androidx.compose.ui.unit.Dp,androidx.compose.material3.DatePickerColors,androidx.compose.ui.window.DialogProperties,kotlin.Function1)`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.ranges/-int-range/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerDefaults#YearRange()` The range of years for the date picker dialogs. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerDefaults#shape()` The default shape for date picker dialogs. | Cmn |

## Constants

### YearAbbrMonthDaySkeleton

Cmn

```
const val YearAbbrMonthDaySkeleton: String
```

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

### YearMonthSkeleton

Cmn

```
const val YearMonthSkeleton: String
```

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

### YearMonthWeekdayDaySkeleton

Cmn

```
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")

## Public functions

### DatePickerHeadline

Cmn

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

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: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html?` | a timestamp that represents the selected date *start* of the day in *UTC* milliseconds from the epoch |
| `displayMode: https://developer.android.com/reference/kotlin/androidx/compose/material3/DisplayMode` | the current `https://developer.android.com/reference/kotlin/androidx/compose/material3/DisplayMode` |
| `dateFormatter: https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerFormatter` | a `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerFormatter` |
| `modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier = Modifier` | a `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` to be applied for the headline |
| `contentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = colors().headlineContentColor` | the content color of this headline |

### DatePickerTitle

Cmn

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

A default date picker title composable.

| Parameters |
|---|---|
| `displayMode: https://developer.android.com/reference/kotlin/androidx/compose/material3/DisplayMode` | the current `https://developer.android.com/reference/kotlin/androidx/compose/material3/DisplayMode` |
| `modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier = Modifier` | a `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` to be applied for the title |
| `contentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = colors().titleContentColor` | the content color of this title |

### colors

Cmn

```
@Composable
fun colors(): DatePickerColors
```

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerColors` that will potentially animate between the provided colors according to the Material specification.

### colors

Cmn

```
@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 `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerColors` that will potentially animate between the provided colors according to the Material specification.

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

### dateFormatter

Cmn

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

Returns a `https://developer.android.com/reference/kotlin/androidx/compose/material3/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 [UTS #35]("http://www.unicode.org/reports/tr35/#Date_Format_Patterns") 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: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html = YearMonthSkeleton` | a date format skeleton used to format the date picker's year selection menu button (e.g. "March 2021"). |
| `selectedDateSkeleton: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html = YearAbbrMonthDaySkeleton` | a date format skeleton used to format a selected date (e.g. "Mar 27, 2021") |
| `selectedDateDescriptionSkeleton: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html = YearMonthWeekdayDaySkeleton` | 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") |

## Public properties

### AllDates

Cmn

```
val AllDates: SelectableDates
```

A default `https://developer.android.com/reference/kotlin/androidx/compose/material3/SelectableDates` that allows all dates to be selected.

### TonalElevation

Cmn

```
val TonalElevation: Dp
```

The default tonal elevation used for `https://developer.android.com/reference/kotlin/androidx/compose/material3/DatePickerDialog.composable#DatePickerDialog(kotlin.Function0,kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Function0,androidx.compose.ui.graphics.Shape,androidx.compose.ui.unit.Dp,androidx.compose.material3.DatePickerColors,androidx.compose.ui.window.DialogProperties,kotlin.Function1)`.

### YearRange

Cmn

```
val YearRange: IntRange
```

The range of years for the date picker dialogs.

### shape

Cmn

```
val shape: Shape
```

The default shape for date picker dialogs.