---
title: "DeviceConfigurationOverride"
description: "Applies [DeviceConfigurationOverride] to the [content] under test to apply some configuration
override.

This can be useful to locally test behavior in isolation that depends on properties that are
normally device-wide, such as [font scale][DeviceConfigurationOverride.Companion.FontScale],
[screen size][DeviceConfigurationOverride.Companion.ForcedSize] and
[layout direction][DeviceConfigurationOverride.Companion.LayoutDirection]."
type: "composable"
---

<div class='type'>Composable Function</div>


<a id='references'></a>

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


```kotlin
@Composable
fun DeviceConfigurationOverride(
    override: DeviceConfigurationOverride,
    content: @Composable () -> Unit,
): Unit
```


Applies `DeviceConfigurationOverride` to the `content` under test to apply some configuration
override.

This can be useful to locally test behavior in isolation that depends on properties that are
normally device-wide, such as `font scale`,
`screen size` and
`layout direction`.

#### Parameters

| | |
| --- | --- |
| override | the `DeviceConfigurationOverride` to apply |
| content | the content under test to apply the override to |





## Code Examples
### DeviceConfigurationOverrideFontScaleSample
```kotlin
@Composable
fun DeviceConfigurationOverrideFontScaleSample() {
    DeviceConfigurationOverride(DeviceConfigurationOverride.FontScale(1.5f)) {
        MyScreen() // will be rendered with a larger than default font scale
    }
}
```
### DeviceConfigurationOverrideForcedSizeSample
```kotlin
@Composable
fun DeviceConfigurationOverrideForcedSizeSample() {
    DeviceConfigurationOverride(DeviceConfigurationOverride.ForcedSize(DpSize(1280.dp, 800.dp))) {
        MyScreen() // will be rendered in the space for 1280dp by 800dp without clipping
    }
}
```
### DeviceConfigurationOverrideLayoutDirectionSample
```kotlin
@Composable
fun DeviceConfigurationOverrideLayoutDirectionSample() {
    DeviceConfigurationOverride(DeviceConfigurationOverride.LayoutDirection(LayoutDirection.Rtl)) {
        MyComponent() // will be rendered with a right-to-left layout direction
    }
}
```

