https://kotlinlang.org logo
#compose
Title
# compose
a

Ayomide

01/24/2021, 1:02 PM
Hi, this question is more about guidance because I'm not sure where to start. I have a
TextField
, and to highlight of the text with colours, say given a list of words to highlight. Basically - syntax highlighting. The image attached gives you an idea of what I mean. Would I have to make my own
TextField
component for this?
d

Dominaezzz

01/24/2021, 1:08 PM
Have a look at
VisualTransformation
for adding colours.
🙏 1
t

Timo Drick

01/24/2021, 1:43 PM
a

Ayomide

01/24/2021, 1:52 PM
Oh, I had no idea about the Compose Desktop examples. Thanks!
t

Timo Drick

01/24/2021, 1:57 PM
It uses a Text element not TextField but i think the highliting also works in TextField. See: EditorView.kt:LineContent
👍 1
s

Siyamed

01/24/2021, 3:06 PM
We don't have support for multi-style text editing yet, hopefully soon this would be possible without VisualTransformation.
5 Views