How to draw a box in the editor


Hello, I’m working on a new package where I would like to temporarily “highlight” a region of text using a transparent box with a solid border. I’ve already gotten something “working” utilizing the highlight decoration and markers, but the look isn’t what I’m going for. I noticed there is an “overlay” decoration, but i’m not sure if this is what I would need to use.

Any pointers would appreciated.



Having a quick mockup would really help so that we can see what you try to achieve.


Here is a mockup of what I’d like to be able to draw… The exact styling of the box isn’t the issue… just the size/placement of it.


I think you can achieve this kind of thing using the decoration API with an overlay decoration:


Hi. I need to do something similar. Did you ever work this out? Thank you.