The Highlighters Library: Painting Real Marker Strokes on Web Text
The Highlighters Library: Painting Real Marker Strokes on Web Text
Let's be honest: most implementations of "highlighting" text on the web are disappointing. You want to feel like you're dragging a yellow marker across a printed page, but what you get is a boring rectangular background color that sits behind your words like a highlighter stuck in a drawer for twenty years.
The Highlighters library changes everything.
More Than Just Background Colors
This isn't about background-color: #ffff00. This is about actual stroke rendering—the kind of detail that separates "functional" from "delightful." When you draw a highlighter stroke, you're seeing:
- Ink pooling where your stroke begins and ends
- Streaks left behind as if the ink is drying mid-mark
- That characteristic bleed past the last letter, just like real ink on paper
Your text remains completely untouched beneath these painterly effects. Users can still select, copy, search, and interact with the highlighted text exactly as they always could.
Three Nibs, Endless Possibilities
The library gives you the three most common highlighter tip shapes:
| Nib Type | Character | Best For | |----------|-----------|----------| | Broad chisel | Wide, flat strokes | Emphasizing entire sentences | | Rounded bullet | Medium, soft edges | General highlighting | | Fine point | Precise, narrow lines | Highlighting individual words |
Mix and match. Layer strokes and watch them interact realistically—the overlap darkens just like multiple passes of a real marker would. Some colors even render with that eye-catching fluorescent quality.
Seamless Integration
The library is refreshingly lightweight and runs anywhere, but if you're using a modern framework, official bindings exist for React, Vue, and Svelte:
npm install @highlighters/core
npm install @highlighters/react
npm install @highlighters/vue
npm install @highlighters/svelte
Where This Shines
Picture this in action:
- Collaborative document editors where users can markup text together
- Online learning platforms letting students annotate reading materials
- Creative writing tools with the satisfying tactility of physical note-taking
- Review systems where stakeholders can highlight important sections
- Accessibility tools helping users visually track their reading position
The Small Details Matter
What impresses me most is the attention to real-world behavior. Highlights maintain their position through scrolling and window resizing. The strokes genuinely sit on top of your content rather than modifying it. This means no layout shifts, no z-index headaches, and no accessibility concerns.
In a web development landscape where we often sacrifice craft for convenience, Highlighters reminds us that the small, tactile details often make the biggest impression. Sometimes the feature your users didn't know they needed is the one that makes them say "wow, this feels different."
Check out the project at https://highlighte.rs/ and give your next project a little more color.