Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-05-15 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-15 UTC."],[],[],null,["# AnnotatedString.Annotation\n==========================\n\nArtifact: [androidx.compose.ui:ui-text](/jetpack/androidx/releases/compose-ui) \n[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/text/AnnotatedString.kt+class:androidx.compose.ui.text.AnnotatedString.Annotation) \nAdded in [1.8.0](/jetpack/androidx/releases/compose-ui#1.8.0)\nCommon/AllAndroid/JVM\n - Cmn \n\n ```\n sealed interface AnnotatedString.Annotation\n``` \nKnown direct subclasses \n[Bullet](/reference/kotlin/androidx/compose/ui/text/Bullet), [LinkAnnotation](/reference/kotlin/androidx/compose/ui/text/LinkAnnotation), [ParagraphStyle](/reference/kotlin/androidx/compose/ui/text/ParagraphStyle), [SpanStyle](/reference/kotlin/androidx/compose/ui/text/SpanStyle), [StringAnnotation](/reference/kotlin/androidx/compose/ui/text/StringAnnotation), [TtsAnnotation](/reference/kotlin/androidx/compose/ui/text/TtsAnnotation), [UrlAnnotation](/reference/kotlin/androidx/compose/ui/text/UrlAnnotation) \n\n|---------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Bullet](/reference/kotlin/androidx/compose/ui/text/Bullet) | Draws a bullet point next to a paragraph. |\n| [LinkAnnotation](/reference/kotlin/androidx/compose/ui/text/LinkAnnotation) | An annotation that represents a clickable part of the text. |\n| [ParagraphStyle](/reference/kotlin/androidx/compose/ui/text/ParagraphStyle) | Paragraph styling configuration for a paragraph. |\n| [SpanStyle](/reference/kotlin/androidx/compose/ui/text/SpanStyle) | Styling configuration for a text span. |\n| [StringAnnotation](/reference/kotlin/androidx/compose/ui/text/StringAnnotation) | An [AnnotatedString.Annotation](/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Annotation) class which holds a String [value](/reference/kotlin/androidx/compose/ui/text/StringAnnotation#value()). |\n| [TtsAnnotation](/reference/kotlin/androidx/compose/ui/text/TtsAnnotation) | An annotation that contains the metadata intended for text-to-speech engine. |\n| [UrlAnnotation](/reference/kotlin/androidx/compose/ui/text/UrlAnnotation) | **This class is deprecated.** Use LinkAnnotatation.Url(url) instead |\n\nKnown indirect subclasses \n[LinkAnnotation.Clickable](/reference/kotlin/androidx/compose/ui/text/LinkAnnotation.Clickable), [LinkAnnotation.Url](/reference/kotlin/androidx/compose/ui/text/LinkAnnotation.Url), [VerbatimTtsAnnotation](/reference/kotlin/androidx/compose/ui/text/VerbatimTtsAnnotation) \n\n|-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| [LinkAnnotation.Clickable](/reference/kotlin/androidx/compose/ui/text/LinkAnnotation.Clickable) | An annotation that contains a clickable marked with [tag](/reference/kotlin/androidx/compose/ui/text/LinkAnnotation.Clickable#tag()). |\n| [LinkAnnotation.Url](/reference/kotlin/androidx/compose/ui/text/LinkAnnotation.Url) | An annotation that contains a [url](/reference/kotlin/androidx/compose/ui/text/LinkAnnotation.Url#url()) string. |\n| [VerbatimTtsAnnotation](/reference/kotlin/androidx/compose/ui/text/VerbatimTtsAnnotation) | The text associated with this annotation is a series of characters that have to be read verbatim. |\n\n*** ** * ** ***\n\nDefines annotations that specify additional information to apply to ranges of text within the given AnnotatedString.\n\nThe AnnotatedString supports annotations that provide different kind of information, such as\n\n- [SpanStyle](/reference/kotlin/androidx/compose/ui/text/SpanStyle) specifies character level styling such as color, font, letter spacing etc.\n\n- [ParagraphStyle](/reference/kotlin/androidx/compose/ui/text/ParagraphStyle) for configuring styling on a paragraph level such as line heights, text aligning, text direction etc.\n\n- [LinkAnnotation](/reference/kotlin/androidx/compose/ui/text/LinkAnnotation) to mark links in the text.\n\n- [TtsAnnotation](/reference/kotlin/androidx/compose/ui/text/TtsAnnotation) provides information to assistive technologies such as screen readers.\n\n- Custom annotations using the [StringAnnotation](/reference/kotlin/androidx/compose/ui/text/StringAnnotation)."]]