Drupal is a registered trademark of Dries Buytaert
Release: Leaflet 10.4.11 Minor update available for module leaflet (10.4.11). Release: Session Inspector 1.0.8 Minor update available for module session_inspector (1.0.8). Release: Migrate QA 2.0.4 Minor update available for module migrate_qa (2.0.4). Release: CKEditor Description List 3.0.0 Major update available for module ckeditor_descriptionlist (3.0.0). Release: FlowDrop 2.4.0 Minor update available for module flowdrop (2.4.0). Release: JWT Token Refresh 1.0.4 Minor update available for module jwt_token_refresh (1.0.4). Release: ConReg 1.0.0-beta1 First beta version released for module conreg (1.0.0-beta1). Release: AI Image Studio 1.0.0-beta8 New beta version released for module ai_image_studio (1.0.0-beta8). Usage Milestone: Role Theme Switcher Module role_theme_switcher crossed 1,000 active installs. Module Revived: Decoupled Router 2.0.7 Module decoupled_router updated after 11 months of inactivity (2.0.7).

The Sticky module allows you to easily make any element on your website, such as a header or footer, remain visible as the user scrolls. Configuration is managed entirely through the user interface.

Creating sticky elements for example a header, a footer, or any other element on your website has never been easier.

The Sticky module implements the Sticky JS library and lets you make any element stay visible on scroll, configured entirely through the UI.

Requirements

  • Drupal 11 or 12
  • The Sticky JS library (garand/sticky) - installed automatically via Composer (see below)

Installation (recommended, via Composer)

The Sticky JS library is not on Packagist, so add this package definition to the repositories section of your project's root composer.json:

{
    "type": "package",
    "package": {
        "name": "garand/sticky",
        "version": "1.0.4",
        "type": "drupal-library",
        "license": "MIT",
        "dist": {
            "type": "zip",
            "url": "https://github.com/garand/sticky/archive/refs/tags/1.0.4.zip"
        },
        "require": {
            "composer/installers": "^1.0 || ^2.0"
        }
    }
}

Make sure your root composer.json maps the drupal-library type to the libraries directory (the drupal/recommended-project template already does this):

"installer-paths": {
    "web/libraries/{$name}": ["type:drupal-library"]
}

Then install the module — the library is fetched into /libraries/sticky along with it:

composer require drupal/sticky

Manual installation

Alternatively, download version 1.0.x of the Sticky library, rename the folder to sticky, and place it in /libraries/ in your Drupal root.

Configuration

  1. Enable the module and clear the cache.
  2. Go to Administration » Configuration » System » Sticky (/admin/config/system/sticky).
  3. Set the DOM selector for the element you want to make sticky.
  4. Optionally adjust the JavaScript settings (spacing, z-index, etc.).
  5. Save the configuration.

Sponsors



Activity

Tracked releases
1
Tracked since
Jun 2026
Latest release
1 month ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Release date
2.3.0 Stable Jun 30, 2026