Rare Scripts is a small collection of free, dependency-free JavaScript UI utilities used as part of the Rare Styles ecosystem.
These scripts are built to solve common interface tasks in a simple, predictable way. No frameworks, no build steps, no hidden magic. Just plain JavaScript you can read, understand, and adapt.
We actively use these scripts in production, in real projects, under real load. They are not demos or experiments, but practical building blocks that help us move faster. If they save time for other developers, especially beginners, that is exactly the point.
All scripts are released under the MIT License and are free to use in personal and commercial projects.
Contributions, comments, and improvements are welcome.
All scripts share one contract: rd-js-* classes are behavioral hooks the script reads (never styled), rd-is-* classes are state the script writes (styled by CSS). Presentational classes stay yours.
Available scripts
- Hamburger — slide-in navigation toggle
- Collapsible — progressively-disclosed content
- Copy to Clipboard — copy links, text, code
- Carousel — small image carousel with travelling captions
- Search — Pagefind overlay toggle (site-specific)
- Cookies — dismissible cookie notice
Examples, usage patterns, and explanations are available at: https://raredigits.art
Minimalism with intent. Reuse encouraged.