# androidx.compose.ui.res

# androidx.compose.ui.res

## Exceptions

|-----------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ResourceResolutionException](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/ResourceResolutionException) | [Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)that is thrown in situations where a resource failed to load. |

## Top-level functions summary

|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                    | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) [booleanResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#booleanResource(kotlin.Int))`(id: @`[BoolRes](https://developer.android.com/reference/kotlin/androidx/annotation/BoolRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Load a boolean resource.                                                                                                                                                                                                                                                                |
| [Color](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color)                                                                             | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) [colorResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#colorResource(kotlin.Int))`(id: @`[ColorRes](https://developer.android.com/reference/kotlin/androidx/annotation/ColorRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Load a color resource.                                                                                                                                                                                                                                                                    |
| [Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)                                                                                       | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) [dimensionResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#dimensionResource(kotlin.Int))`(id: @`[DimenRes](https://developer.android.com/reference/kotlin/androidx/annotation/DimenRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Load a dimension resource.                                                                                                                                                                                                                                                        |
| [Typeface](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/Typeface)                                                                      | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) ~~[fontResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#fontResource(androidx.compose.ui.text.font.FontFamily))~~`(fontFamily: `[FontFamily](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily)`)` **This function is deprecated.**Prefer to preload fonts using FontFamily.Resolver.                                                                                                                                                                                                                                 |
| [IntArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html)                                                                                 | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) [integerArrayResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#integerArrayResource(kotlin.Int))`(id: @`[ArrayRes](https://developer.android.com/reference/kotlin/androidx/annotation/ArrayRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Load an array of integer resource.                                                                                                                                                                                                                                          |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                            | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) [integerResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#integerResource(kotlin.Int))`(id: @`[IntegerRes](https://developer.android.com/reference/kotlin/androidx/annotation/IntegerRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Load an integer resource.                                                                                                                                                                                                                                                         |
| [Painter](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter)                                                                 | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) [painterResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#painterResource(kotlin.Int))`(id: @`[DrawableRes](https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Create a[Painter](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter)from an Android resource id.                                                                                                                                      |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                      | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) [pluralStringResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#pluralStringResource(kotlin.Int,kotlin.Int))`(id: @`[PluralsRes](https://developer.android.com/reference/kotlin/androidx/annotation/PluralsRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, count: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Load a plurals resource.                                                                                                                                               |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                      | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) [pluralStringResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#pluralStringResource(kotlin.Int,kotlin.Int,kotlin.Array))`(id: @`[PluralsRes](https://developer.android.com/reference/kotlin/androidx/annotation/PluralsRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, count: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, vararg formatArgs: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`)` Load a plurals resource with provided format arguments. |
| [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`>` | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) [stringArrayResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#stringArrayResource(kotlin.Int))`(id: @`[ArrayRes](https://developer.android.com/reference/kotlin/androidx/annotation/ArrayRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Load a string resource.                                                                                                                                                                                                                                                       |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                      | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) [stringResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#stringResource(kotlin.Int))`(id: @`[StringRes](https://developer.android.com/reference/kotlin/androidx/annotation/StringRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Load a string resource.                                                                                                                                                                                                                                                               |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                      | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) [stringResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#stringResource(kotlin.Int,kotlin.Array))`(id: @`[StringRes](https://developer.android.com/reference/kotlin/androidx/annotation/StringRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, vararg formatArgs: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`)` Load a string resource with formatting.                                                                                                                                |

## Extension functions summary

|---------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ImageBitmap](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ImageBitmap)        | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) [ImageBitmap.Companion](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ImageBitmap.Companion)`.`[imageResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#(androidx.compose.ui.graphics.ImageBitmap.Companion).imageResource(kotlin.Int))`(id: @`[DrawableRes](https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Load an ImageBitmap from an image resource.                                                               |
| [ImageBitmap](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ImageBitmap)        | [ImageBitmap.Companion](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ImageBitmap.Companion)`.`[imageResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#(androidx.compose.ui.graphics.ImageBitmap.Companion).imageResource(android.content.res.Resources,kotlin.Int))`(res: `[Resources](https://developer.android.com/reference/android/content/res/Resources.html)`, id: @`[DrawableRes](https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Load an ImageBitmap from an image resource.                                     |
| [ImageVector](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/vector/ImageVector) | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) [ImageVector.Companion](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/vector/ImageVector.Companion)`.`[vectorResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#(androidx.compose.ui.graphics.vector.ImageVector.Companion).vectorResource(kotlin.Int))`(id: @`[DrawableRes](https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Load an ImageVector from a vector resource.                                               |
| [ImageVector](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/vector/ImageVector) | [ImageVector.Companion](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/vector/ImageVector.Companion)`.`[vectorResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#(androidx.compose.ui.graphics.vector.ImageVector.Companion).vectorResource(android.content.res.Resources.Theme,android.content.res.Resources,kotlin.Int))`(` ` theme: `[Resources.Theme](https://developer.android.com/reference/android/content/res/Resources.Theme.html)`?,` ` res: `[Resources](https://developer.android.com/reference/android/content/res/Resources.html)`,` ` resId: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) `)` |

## Top-level functions

### booleanResource

Artifact:[androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/res/PrimitiveResources.android.kt+function:booleanResource)  

```
@Composable
fun booleanResource(id: @BoolRes Int): Boolean
```

Load a boolean resource.  

|                                                                                 Parameters                                                                                 |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `id: @`[BoolRes](https://developer.android.com/reference/kotlin/androidx/annotation/BoolRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the resource identifier |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | the boolean associated with the resource |

### colorResource

Artifact:[androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/res/ColorResources.android.kt+function:colorResource)  

```
@Composable
fun colorResource(id: @ColorRes Int): Color
```

Load a color resource.  

|                                                                                  Parameters                                                                                  |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `id: @`[ColorRes](https://developer.android.com/reference/kotlin/androidx/annotation/ColorRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the resource identifier |

|                                          Returns                                           |
|--------------------------------------------------------------------------------------------|----------------------------------------|
| [Color](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color) | the color associated with the resource |

### dimensionResource

Artifact:[androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/res/PrimitiveResources.android.kt+function:dimensionResource)  

```
@Composable
fun dimensionResource(id: @DimenRes Int): Dp
```

Load a dimension resource.  

|                                                                                  Parameters                                                                                  |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `id: @`[DimenRes](https://developer.android.com/reference/kotlin/androidx/annotation/DimenRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the resource identifier |

|                                     Returns                                      |
|----------------------------------------------------------------------------------|--------------------------------------------------|
| [Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp) | the dimension value associated with the resource |

### fontResource

Artifact:[androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/res/FontResources.android.kt+function:fontResource)  

```
@Composable
fun [fontResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#fontResource(androidx.compose.ui.text.font.FontFamily))(fontFamily: FontFamily): Typeface
```
| **This function is deprecated.**   
| Prefer to preload fonts using FontFamily.Resolver.

Synchronously load an font from[FontFamily](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily).  

|                                                     Parameters                                                      |
|---------------------------------------------------------------------------------------------------------------------|----------------|
| `fontFamily: `[FontFamily](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily) | the fontFamily |

|                                              Returns                                              |
|---------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| [Typeface](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/Typeface) | the decoded image data associated with the resource |

### integerArrayResource

Artifact:[androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/res/PrimitiveResources.android.kt+function:integerArrayResource)  

```
@Composable
fun integerArrayResource(id: @ArrayRes Int): IntArray
```

Load an array of integer resource.  

|                                                                                  Parameters                                                                                  |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `id: @`[ArrayRes](https://developer.android.com/reference/kotlin/androidx/annotation/ArrayRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the resource identifier |

|                                        Returns                                         |
|----------------------------------------------------------------------------------------|------------------------------------------------|
| [IntArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html) | the integer array associated with the resource |

### integerResource

Artifact:[androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/res/PrimitiveResources.android.kt+function:integerResource)  

```
@Composable
fun integerResource(id: @IntegerRes Int): Int
```

Load an integer resource.  

|                                                                                    Parameters                                                                                    |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `id: @`[IntegerRes](https://developer.android.com/reference/kotlin/androidx/annotation/IntegerRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the resource identifier |

|                                   Returns                                   |
|-----------------------------------------------------------------------------|------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the integer associated with the resource |

### painterResource

Artifact:[androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/res/PainterResources.android.kt+function:painterResource)  

```
@Composable
fun painterResource(id: @DrawableRes Int): Painter
```

Create a[Painter](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter)from an Android resource id. This can load either an instance of[BitmapPainter](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/BitmapPainter)or[VectorPainter](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/vector/VectorPainter)for[ImageBitmap](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ImageBitmap)based assets or vector based assets respectively. The resources with the given id must point to either fully rasterized images (ex. PNG or JPG files) or VectorDrawable xml assets. API based xml Drawables are not supported here.

Example:  

```kotlin
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.requiredSize
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.paint
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp

// Sample showing how to render a Painter based on a different resource (vector vs png)
// Here a Vector asset is used in the portrait orientation, however, a png is used instead
// in the landscape orientation based on the res/drawable and res/drawable-land-hdpi folders
Image(
    painterResource(R.drawable.ic_vector_or_png),
    contentDescription = null,
    modifier = Modifier.requiredSize(50.dp),
)
```

Alternative Drawable implementations can be used with compose by calling[drawIntoCanvas](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawIntoCanvas(kotlin.Function1))and drawing with the Android framework canvas provided through[nativeCanvas](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/package-summary#(androidx.compose.ui.graphics.Canvas).nativeCanvas())

Example:  

```kotlin
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.requiredSize
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
import androidx.compose.ui.graphics.nativeCanvas
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp

val drawable = LocalContext.current.getDrawable(R.drawable.sample_drawable)
Box(
    modifier =
        Modifier.requiredSize(100.dp).drawBehind {
            drawIntoCanvas { canvas ->
                drawable?.let {
                    it.setBounds(0, 0, size.width.roundToInt(), size.height.roundToInt())
                    it.draw(canvas.nativeCanvas)
                }
            }
        }
)
```  

|                                                                                     Parameters                                                                                     |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|
| `id: @`[DrawableRes](https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Resources object to query the image file from |

|                                                Returns                                                 |
|--------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| [Painter](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter) | [Painter](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter)used for drawing the loaded resource |

### pluralStringResource

Artifact:[androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/res/StringResources.android.kt+function:pluralStringResource)  

```
@Composable
fun pluralStringResource(id: @PluralsRes Int, count: Int): String
```

Load a plurals resource.  

|                                                                                    Parameters                                                                                    |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `id: @`[PluralsRes](https://developer.android.com/reference/kotlin/androidx/annotation/PluralsRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the resource identifier |
| `count: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                             | the count               |

|                                      Returns                                      |
|-----------------------------------------------------------------------------------|---------------------------------------------------------|
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | the pluralized string data associated with the resource |

### pluralStringResource

Artifact:[androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/res/StringResources.android.kt+function:pluralStringResource)  

```
@Composable
fun pluralStringResource(id: @PluralsRes Int, count: Int, vararg formatArgs: Any): String
```

Load a plurals resource with provided format arguments.  

|                                                                                    Parameters                                                                                    |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| `id: @`[PluralsRes](https://developer.android.com/reference/kotlin/androidx/annotation/PluralsRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the resource identifier             |
| `count: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                             | the count                           |
| `vararg formatArgs: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)                                                                                 | arguments used in the format string |

|                                      Returns                                      |
|-----------------------------------------------------------------------------------|---------------------------------------------------------|
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | the pluralized string data associated with the resource |

### stringArrayResource

Artifact:[androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/res/StringResources.android.kt+function:stringArrayResource)  

```
@Composable
fun stringArrayResource(id: @ArrayRes Int): Array<String>
```

Load a string resource.  

|                                                                                  Parameters                                                                                  |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `id: @`[ArrayRes](https://developer.android.com/reference/kotlin/androidx/annotation/ArrayRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the resource identifier |

|                                                                                Returns                                                                                 |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|
| [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`>` | the string data associated with the resource |

### stringResource

Artifact:[androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/res/StringResources.android.kt+function:stringResource)  

```
@Composable
fun stringResource(id: @StringRes Int): String
```

Load a string resource.  

|                                                                                   Parameters                                                                                   |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `id: @`[StringRes](https://developer.android.com/reference/kotlin/androidx/annotation/StringRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the resource identifier |

|                                      Returns                                      |
|-----------------------------------------------------------------------------------|----------------------------------------------|
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | the string data associated with the resource |

### stringResource

Artifact:[androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/res/StringResources.android.kt+function:stringResource)  

```
@Composable
fun stringResource(id: @StringRes Int, vararg formatArgs: Any): String
```

Load a string resource with formatting.  

|                                                                                   Parameters                                                                                   |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `id: @`[StringRes](https://developer.android.com/reference/kotlin/androidx/annotation/StringRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the resource identifier |
| `vararg formatArgs: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)                                                                               | the format arguments    |

|                                      Returns                                      |
|-----------------------------------------------------------------------------------|----------------------------------------------|
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | the string data associated with the resource |

## Extension functions

### imageResource

Artifact:[androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/res/ImageResources.android.kt+function:imageResource)  

```
@Composable
fun ImageBitmap.Companion.imageResource(id: @DrawableRes Int): ImageBitmap
```

Load an ImageBitmap from an image resource.

This function is intended to be used for when low-level ImageBitmap-specific functionality is required. For simply displaying onscreen, the vector/bitmap-agnostic[painterResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#painterResource(kotlin.Int))is recommended instead.  

|                                                                                     Parameters                                                                                     |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `id: @`[DrawableRes](https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the resource identifier |

|                                                Returns                                                 |
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| [ImageBitmap](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ImageBitmap) | the decoded image data associated with the resource |

### imageResource

Artifact:[androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/res/ImageResources.android.kt+function:imageResource)  

```
fun ImageBitmap.Companion.imageResource(res: Resources, id: @DrawableRes Int): ImageBitmap
```

Load an ImageBitmap from an image resource.

This function is intended to be used for when low-level ImageBitmap-specific functionality is required. For simply displaying onscreen, the vector/bitmap-agnostic[painterResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#painterResource(kotlin.Int))is recommended instead.  

|                                                Returns                                                 |
|--------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| [ImageBitmap](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ImageBitmap) | Loaded image file represented as an[ImageBitmap](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ImageBitmap) |

### vectorResource

Artifact:[androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/res/VectorResources.android.kt+function:vectorResource)  

```
@Composable
fun ImageVector.Companion.vectorResource(id: @DrawableRes Int): ImageVector
```

Load an ImageVector from a vector resource.

This function is intended to be used for when low-level ImageVector-specific functionality is required. For simply displaying onscreen, the vector/bitmap-agnostic[painterResource](https://developer.android.com/reference/kotlin/androidx/compose/ui/res/package-summary#painterResource(kotlin.Int))is recommended instead.  

|                                                                                     Parameters                                                                                     |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `id: @`[DrawableRes](https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the resource identifier |

|                                                    Returns                                                    |
|---------------------------------------------------------------------------------------------------------------|----------------------------------------------|
| [ImageVector](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/vector/ImageVector) | the vector data associated with the resource |

### vectorResource

Artifact:[androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/res/VectorResources.android.kt+function:vectorResource)  

```
fun ImageVector.Companion.vectorResource(
    theme: Resources.Theme? = null,
    res: Resources,
    resId: Int
): ImageVector
```