---
title: "StringAnnotation"
description: "An [AnnotatedString.Annotation] class which holds a String [value].

You can use it to provide a custom annotation to the [AnnotatedString].

If you use the [AnnotatedString.Builder] methods like [withAnnotation] and provide a string
annotation, it will be automatically wrapped into this holder class."
type: "class"
---

<div class='type'>Class</div>


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

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


```kotlin
value class StringAnnotation(val value: String) : AnnotatedString.Annotation
```


An `AnnotatedString.Annotation` class which holds a String `value`.

You can use it to provide a custom annotation to the `AnnotatedString`.

If you use the `AnnotatedString.Builder` methods like `withAnnotation` and provide a string
annotation, it will be automatically wrapped into this holder class.



