diff --git a/docs/links.md b/docs/links.md index 0c6a129c..956ec039 100644 --- a/docs/links.md +++ b/docs/links.md @@ -15,4 +15,20 @@ To get if the current selection is a link, use `RichTextState.isLink`: ```kotlin // Get if the current selection is a link. val isLink = richTextState.isLink -``` \ No newline at end of file +``` + +By default, links will be opened by your platform's `UriHandler`, if however you want to +handle the links on your own, you can override the composition local as such: + +```kotlin +val myUriHandler by remember { + mutableStateOf(object : UriHandler { + override fun openUri(uri: String) { + // Handle the clicked link however you want + } + }) +} +CompositionLocalProvider(LocalUriHandler provides myUriHandler) { + RichText( ... ) +} +```