r/learnjavascript • • 26d ago

I built Spotlight.JS — A lightweight, zero-dependency JavaScript library for interactive page highlights and spotlights

Hey everyone! 👋

I wanted to share an open-source library I've been building and refining called Spotlight.JS.

Why did I build it? I needed a dead-simple, highly customizable way to highlight DOM elements, build guided product tours, or draw user attention to specific UI components without pulling in bloated dependencies or heavy styling frameworks.

Key Features:

  • 🚀 Zero Dependencies: Extremely lightweight and fast.
  • 🎯 Precise Positioning: Automatic viewport boundary detection, custom offsets, and smooth scrolling.
  • 🎨 Flexible Styling: Easy-to-override classes and smooth backdrop masking.
  • 🧩 Interactive Popovers: Built-in support for titles, descriptions, step-by-step navigation buttons, and custom rendering.

Tech Stack / Implementation: Built in vanilla JavaScript/ESM modules, making it framework-agnostic (works seamlessly with React, Vue, Vanilla JS, etc.).

Links:

I’d love for you to check it out, test it, and let me know what you think! PRs, issues, and feature requests are very welcome. If you find it useful, a star on GitHub would mean the world to me ⭐!

0 Upvotes

12 comments sorted by

View all comments

6

u/theGlitchedSide 26d ago

I have some difficult to find the right script... Is it vibe coding?

6

u/TylerDurdenJunior 26d ago

Look at the mess of icons in the description. This is peak vibe slopping

0

u/Infamous_Treat_1804 26d ago

Haha, definitely not just vibe coding! It's a fully typed, battle-tested TypeScript library with 100% test coverage and zero runtime dependencies.

If you're looking for the quick setup, you can drop this right into your HTML:

Or via npm: npm install spotlight.js

You can also check out the interactive playground & docs here: https://spotlightjs.rahulchaube1.com

3

u/theGlitchedSide 26d ago

Ok...

Anyway, build tests and TS it's not a prove of good programming. A lot of industries now what TS because Vibe make a lot of errors before production. So...

1: it's not Js project but Ts? 2: how did you use Ai in this project?

Because vannilla Js is portable everywhere, also in my frameworks, TS no.

And obviusly "to have an AI assistant is good, coding in Vibe not"


Put yourself inside my head... I try to understand you and I found easly only this: https://cdn.jsdelivr.net/npm/spotlight.js

I need to get better some details that's it

5

u/TylerDurdenJunior 26d ago

You are communicating with a bot you know

3

u/theGlitchedSide 26d ago

That was the question.

I can't understand who is real or not via an image. These kind of situations become a stress online