Logo
Colorbox example with the default style

Colorbox is a light-weight customizable lightbox plugin for jQuery. This module allows for integration of Colorbox into Drupal.

Images, iframed or inline content etc. can be displayed in a overlay above the current page.

Features

The Colorbox module:

  • Works as a Formatter in entities and in views.
  • Excellent integration with core image field and image styles and the Insert module
  • Choose between a default style and a number of other styles that are included.
  • Style the Colorbox with a custom Colorbox style in your theme.
  • Drush command, drush colorbox-plugin, to download and install the Colorbox plugin in sites/all/libraries.

The Colorbox plugin:

  • Compatible with: jQuery 1.3.2+ in Firefox, Safari, Chrome, Opera, Internet Explorer 7+
  • Supports photos, grouping, slideshow, ajax, inline, and iframed content.
  • Lightweight: 10KB of JavaScript (less than 5KBs gzipped).
  • Appearance is controlled through CSS so it can be restyled.
  • Can be extended with callbacks & event-hooks without altering the source files.
  • Completely unobtrusive, options are set in the JS and require no changes to existing HTML.
  • Preloads upcoming images in a photo group.
  • Currently used on more than 2 million websites.
  • Released under the MIT License

The plugin must be downloaded separately.

Supporting HTML captions

If you wish to use HTML in your Colorbox captions, you must also download and install the DOMPurify library. This library is optional. If you do not install it, all captions will be converted to plain text.

Colorbox for Drupal 8

Colorbox for Drupal 8 is an image field formatter and nothing more, or less. The extra features like colorbox_load and colorbox_inline can be found in contrib.

If you are using the DOMPurify library, you can use drush colorbox:dompurify to install the library. It looks for the library in libraries/DOMPurify/dist/purify.min.js.

Colorbox for Drupal 7

Installation for Drupal 7

Download and install the Libraries API 2 module and the Colorbox module as normal. Then download the Colorbox plugin. Make sure to use the 1.x branch since that will stay backwards compatible with older jQuery version, like the ones included with Drupal.

Download Colorbox plugin 1.x

Unpack and rename the plugin directory to "colorbox" and place it inside the "sites/all/libraries" directory. Make sure the path to the plugin file becomes: "sites/all/libraries/colorbox/jquery.colorbox-min.js"

If you are also using the DOMPurify library to support HTML captions, install it in:
sites/all/libraries/DOMPurify/purify.min.js

Colorbox screencasts

Part 1 to 3 is for an older 7.x-1.x version of the Colorbox module.

Contributed screencasts:

Modules that extend Colorbox

Modules that have built in support for Colorbox

Dependencies

  • All versions: The Colorbox plugin 1.x
    • 8.x: installed in the libraries directory so the path becomes "libraries/colorbox/jquery.colorbox-min.js"
    • 7.x and older: installed in sites/all/libraries directory so the path becomes "sites/all/libraries/colorbox/jquery.colorbox-min.js"
  • Drupal 7.x-2.x only: Libraries API 2
  • Drupal 6 only: The Old 1.3.18 version of the Colorbox plugin and jQuery Update module version 6.x-2.0-alpha1 or later

You need to download the Colorbox plugin from the site above, the git repo doesn't contains the minified version so will not work. The easiest way to download and install the plugin is via the built in Drush command, drush colorbox-plugin.

Credits: Colorbox logo by Nico Grienauer (Grienauer)

Sponsor

Development of this module is supported by PhpStorm Open Source license from JetBrains.

Supporting organizations: 
Drupal 7/8/9 security updates and maintenance
Drupal 8/9 maintenance and development
Development and bug fixing
Development and bug fixing

Project information

Releases