Skip to content

# njX UI v1.0.5 — Animations · Popups · Hovers · Buttons

Choose a tag to compare

@njbSaab njbSaab released this 31 Mar 18:36
· 247 commits to main since this release

Release date: 2026-03-31

Major visual update: entrance animations, popup system, extended hover effects, and a full button refresh.


✨ New: Animations

anim

CSS-only entrance animations via utility classes. Drop onto any element — no JS required.

Class Effect
.anim-fade-in Fade in from transparent
.anim-slide-up Slide in from bottom
.anim-slide-down Slide in from top
.anim-slide-left Slide in from right
.anim-slide-right Slide in from left
.anim-zoom-in Scale up from 0.8
.anim-zoom-out Scale down from 1.2
.anim-bounce Bounce entrance
.anim-flip-x Flip on X axis
.anim-flip-y Flip on Y axis

Duration modifiers: .anim-fast (0.2s) · .anim-normal (0.4s) · .anim-slow (0.8s)

Delay modifiers: .anim-delay-1 through .anim-delay-5 (steps of 100ms)

Easing modifiers: .anim-ease · .anim-ease-in · .anim-ease-out · .anim-spring

<div class="anim-fade-in anim-slow anim-delay-2">Hello</div>
<div class="anim-slide-up anim-spring">Card</div>

✨ New: Popups

popup

Fully accessible modal/popup system. CSS structure + lightweight JS helpers from njx.js.

Base structure

<button class="btn btn-primary" onclick="popupOpen('my-popup')">Open</button>

<div class="popup-backdrop" id="my-popup-backdrop" onclick="popupClose('my-popup')"></div>

<div class="popup" id="my-popup">
  <div class="popup-dialog">
    <div class="popup-header">
      <span class="popup-title">Title</span>
      <button class="popup-close" onclick="popupClose('my-popup')">✕</button>
    </div>
    <div class="popup-body">
      Content goes here.
    </div>
    <div class="popup-footer">
      <button class="btn btn-outline" onclick="popupClose('my-popup')">Cancel</button>
      <button class="btn btn-primary">Confirm</button>
    </div>
  </div>
</div>

Variants

Class Style
(default) Centered modal with backdrop
.popup-sm Small dialog (400px max)
.popup-lg Large dialog (800px max)
.popup-fullscreen Fills entire viewport
.popup-bottom Bottom sheet — slides up from bottom edge
.popup-glass Glassmorphism backdrop-filter dialog

JS API

popupOpen('my-popup')    // open
popupClose('my-popup')   // close
popupToggle('my-popup')  // toggle

Behavior: body scroll locks when popup is open. Escape key closes the active popup automatically.


✨ New: Hovers

Extended hover effect utilities — add visual feedback to any interactive element.

Class Effect
.hover-lift Translate Y up + shadow on hover
.hover-sink Translate Y down on hover
.hover-glow Primary color box-shadow glow
.hover-glow-accent Accent color glow
.hover-scale Scale up to 1.05
.hover-scale-down Scale down to 0.97
.hover-bright Brightness boost via filter
.hover-dim Opacity dim
.hover-rotate Slight rotate (3deg)
.hover-border Border appears on hover
.hover-bg Background color fill on hover
.hover-underline Animated underline from left

All effects use CSS transitions — no JS, no classes toggled manually.

<div class="card hover-lift hover-glow">...</div>
<img class="hover-scale hover-bright" src="..." />
<a class="hover-underline" href="#">Learn more</a>

✨ Improved: Buttons

buttons

Button system expanded with new variants, sizes, and states.

New variants

Class Style
.btn-ghost Transparent background, border on hover
.btn-gradient Gradient fill using primary → accent
.btn-glass Glassmorphism frosted button
.btn-soft Muted tinted background (soft fill)
.btn-icon Square icon-only button, equal padding

New sizes

Class Height
.btn-xs 24px
.btn-sm 32px
.btn-md 40px (default)
.btn-lg 48px
.btn-xl 56px

New state classes

Class Behavior
.btn-loading Replaces label with spinner, disables interaction
.btn-block Full width (width: 100%)
.is-active Pressed/active visual state

Group layout

<div class="btn-group">
  <button class="btn btn-outline">Left</button>
  <button class="btn btn-outline is-active">Center</button>
  <button class="btn btn-outline">Right</button>
</div>

📦 CDN

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/njbSaab/njx-css-ui@v1.0.5/css/style.min.css">
<script src="https://cdn.jsdelivr.net/gh/njbSaab/njx-css-ui@v1.0.5/js/njx.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/njx-ui@1.0.5/css/style.min.css">
<script src="https://cdn.jsdelivr.net/npm/njx-ui@1.0.5/js/njx.js"></script>