---
title: "stringResource"
description: "Load a string resource."
type: "composable"
---

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


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

<div class='sourceset sourceset-android'>Android</div>


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


Load a string resource.

#### Parameters

| | |
| --- | --- |
| id | the resource identifier |


#### Returns

| | |
| --- | --- |
|  | the string data associated with the resource |




<div class='sourceset sourceset-android'>Android</div>


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


Load a string resource with formatting.

#### Parameters

| | |
| --- | --- |
| id | the resource identifier |
| formatArgs | the format arguments |


#### Returns

| | |
| --- | --- |
|  | the string data associated with the resource |





