---
title: "getOrElse"
description: "Returns the resolved value of [property] if set, or the result of [defaultValue]."
type: "function"
lastmod: "2026-09-24"
---
## API Reference

### getOrElse

> Source set: Common

```kotlin
public inline fun <T> StylePropertyAccessorScope.getOrElse(
    property: StyleProperty<T>,
    crossinline defaultValue: () -> T,
): T
```

Returns the resolved value of `property` if set, or the result of `defaultValue`.

#### Parameters

| | |
| --- | --- |
| property | property to retrieve |
| defaultValue | fallback calculation when `property` is not set |
