# ButtonDefaults

Artifact: [androidx.xr.glimmer:glimmer](https://developer.android.com/jetpack/androidx/releases/xr-glimmer) [View Source](https://cs.android.com/search?q=file:androidx/xr/glimmer/Button.kt+class:androidx.xr.glimmer.ButtonDefaults) Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/xr-glimmer#1.0.0-alpha22)


```
object ButtonDefaults
```

<br />

*** ** * ** ***

Default values used for `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Button.composable#Button(kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.xr.glimmer.ButtonSize,kotlin.Function0,kotlin.Function0,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function1)`.

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/PaddingValues` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/xr/glimmer/ButtonDefaults#contentPadding(androidx.xr.glimmer.ButtonSize)(buttonSize: https://developer.android.com/reference/kotlin/androidx/xr/glimmer/ButtonSize)` Default content padding used for a `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Button.composable#Button(kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.xr.glimmer.ButtonSize,kotlin.Function0,kotlin.Function0,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function1)` with the specified `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/ButtonDefaults#contentPadding(androidx.xr.glimmer.ButtonSize)`. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/xr/glimmer/ButtonDefaults#focusedColor(androidx.compose.ui.graphics.Color)(baseColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color)` Returns the focused background `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` for a button derived from the provided `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/ButtonDefaults#focusedColor(androidx.compose.ui.graphics.Color)`. |

## Public functions

### contentPadding

Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/xr-glimmer#1.0.0-alpha22)

```
@Composable
fun contentPadding(buttonSize: ButtonSize): PaddingValues
```

Default content padding used for a `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Button.composable#Button(kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.xr.glimmer.ButtonSize,kotlin.Function0,kotlin.Function0,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function1)` with the specified `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/ButtonDefaults#contentPadding(androidx.xr.glimmer.ButtonSize)`.

### focusedColor

Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/xr-glimmer#1.0.0-alpha22)

```
@Composable
fun focusedColor(baseColor: Color = GlimmerTheme.colors.surface): Color
```

Returns the focused background `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` for a button derived from the provided `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/ButtonDefaults#focusedColor(androidx.compose.ui.graphics.Color)`.

Adjusts the provided `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/ButtonDefaults#focusedColor(androidx.compose.ui.graphics.Color)` so that it is suitable for use as a focused button background.

| Parameters |
|---|---|
| `baseColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = GlimmerTheme.colors.surface` | the base `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` of the button |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | the focused button background `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color`, adjusted to improve content contrast |