Skip to content
S

Surreal

🗿 Mini jQuery alternative

by gnatFree

#1639in Utilities
0In stores

Description

Surreal is a tiny helper library that gives plain JavaScript a jQuery-style way to select and change elements, without a build step or depen…

Highlights

  • me() for one element, any() for many
  • Locality of Behavior with me() in inline code
  • Chainable jQuery-style functions
  • Animations and tweens without extra libraries
  • About 320 lines, no dependencies

Ratings & Reviews

No ratings yet

Be the first to rate Surreal.

People also visit

H

///_hyperscript

An async-transparent scripting langauge for the web

Utilities
Launch
A

Anime

JavaScript animation engine

Design
Launch
A

animejs

Versatile JavaScript animation engine for DOM, CSS, SVG, and JavaScript objects

AI Skills
Get
V

@viselect/vanilla

Simple, lightweight and modern library library for making visual DOM Selections

UI Libraries
Launch
S

SSGOI

animated page transition for major ssr frameworks and browsers, including Safari

Utilities
Launch
J

@jis3r/icons

beautifully crafted, moving icons. for svelte

UI Libraries
Launch

Surreal FAQ

What is Surreal?

A tiny JavaScript library that offers a jQuery-style syntax for selecting and changing DOM elements, in plain JavaScript.

Does it need a build step?

No. The README says there is no build step and no dependencies, and it can be downloaded or loaded from a CDN.

What is the difference between me() and any()?

me() returns one element, or the first match, or null. any() always returns an array, which may be empty.

What is Locality of Behavior?

Inside an inline script, me() refers to the element the script belongs to, so you do not need a class or id.

Does it work with htmx?

The README says it pairs well with htmx.

What are the best Surreal alternatives?

Popular alternatives to Surreal include ///_hyperscript, SSGOI and Motion Core. See all Surreal alternatives

Developer Stuff

Badges