Libraries included in Drupal 7 core

There're many JavaScript libraries included in the Drupal 7 core. Many of them are rarely used in custom modules (I haven't used many of them) but they're helpful in some situations and it's nice to kwow what are inside the core as baseline knowledge for Drupal development.

Here is a list of the libraries. Each library comprises of a machine name, title, website and description in the following format.

  • machine name
    • title
    • website
    • description

Drupal 7 core JavaScript libraries

  • drupal.ajax
    • Drupal AJAX
    • http://api.drupal.org/api/drupal/includes--ajax.inc/group/ajax/7
    • Drupal's original library. Provides assets for Drupal's Ajax framework.
  • drupal.batch
    • Drupal batch API
    • ...
    • Drupal's original library. Provides assets for Drupal's batch system.
  • drupal.progress
    • Drupal progress indicator
    • ...
    • Drupal's original library. Provides assets to show progress indicator.
  • drupal.form
    • Drupal form library
    • ...
    • Drupal's original library. Provides form related assets.
  • drupal.states
    • Drupal states
    • ...
    • Drupal's original library. Provides states API related assets.
  • drupal.collapse
    • Drupal collapsible fieldset
    • ...
    • Drupal's original library. Provides assets for collapsible fieldset.
  • drupal.textarea
    • Drupal resizable textarea
    • ...
    • Drupal's original library. Provides assets for resizable textarea.
  • drupal.autocomplete
    • Drupal autocomplete
    • ...
    • Drupal's original library. Provides assets for autocomplete widget.
  • drupal.vertical-tabs
    • Vertical Tabs
    • http://drupal.org/node/323112
    • Drupal's original library. Provides assets for vertical Tabs.
  • jquery
    • jQuery
    • https://jquery.com
    • jQuery library everyone in the Web industry knows.
  • jquery.once
    • jQuery Once
    • http://plugins.jquery.com/once/
    • Filters out all elements that had the same filter applied on them before. It can be used to ensure that a function is only applied once to an element.
  • jquery.form
    • jQuery Form Plugin
    • http://malsup.com/jquery/form/
    • The jQuery Form Plugin allows you to easily and unobtrusively upgrade HTML forms to use AJAX.
  • jquery.bbq
    • jQuery BBQ
    • http://benalman.com/projects/jquery-bbq-plugin/
    • jQuery BBQ leverages the HTML5 hashchange event to allow simple, yet powerful bookmarkable #hash history. In addition, jQuery BBQ provides a full .deparam() method, along with both hash state management, and fragment / query string parse and merge utility methods.
  • farbtastic
    • Farbtastic
    • http://code.google.com/p/farbtastic/
    • Farbtastic is a jQuery plug-in that can add one or more color picker widgets into a page.
  • jquery.cookie
    • Cookie
    • http://plugins.jquery.com/cookie
    • A simple, lightweight jQuery plugin for reading, writing and deleting cookies.
  • ui
    • jQuery UI: Core
    • http://jqueryui.com
    • jQuery UI everyone knows.
  • ui.accordion
    • jQuery UI: Accordion
    • http://jqueryui.com/accordion/
    • Displays collapsible content panels for presenting information in a limited amount of space.
  • ui.autocomplete
    • jQuery UI: Autocomplete
    • http://jqueryui.com/demos/autocomplete/
    • Enables users to quickly find and select from a pre-populated list of values as they type, leveraging searching and filtering.
  • ui.button
    • jQuery UI: Button
    • http://jqueryui.com/demos/button/
    • Enhances standard form elements like buttons, inputs and anchors to themeable buttons with appropriate hover and active styles.
  • ui.datepicker
    • jQuery UI: Date Picker
    • http://jqueryui.com/datepicker/
    • Select a date from a popup or inline calendar
  • ui.dialog
    • jQuery UI: Dialog
    • http://jqueryui.com/dialog/
    • Open content in an interactive overlay.
  • ui.draggable
    • jQuery UI: Draggable
    • http://jqueryui.com/demos/draggable/
    • Allow elements to be moved using the mouse.
  • ui.droppable
    • jQuery UI: Droppable
    • http://jqueryui.com/demos/droppable/
    • Create targets for draggable elements.
  • ui.mouse
    • jQuery UI: Mouse
    • https://plugins.jquery.com/ui.mouse/
    • Abstracts mouse-based interactions to assist in creating certain widgets.
  • ui.position
    • jQuery UI: Position
    • http://jqueryui.com/position/
    • Position an element relative to the window, document, another element, or the cursor/mouse.
  • ui.progressbar
    • jQuery UI: Progress Bar
    • http://jqueryui.com/progressbar/
    • Display status of a determinate or indeterminate process.
  • ui.resizable
    • jQuery UI: Resizable
    • http://jqueryui.com/resizable/
    • Change the size of an element using the mouse.
  • ui.selectable
    • jQuery UI: Selectable
    • http://jqueryui.com/selectable/
    • Use the mouse to select elements, individually or in a group.
  • ui.slider
    • jQuery UI: Slider
    • http://jqueryui.com/slider/
    • Drag a handle to select a numeric value.
  • ui.sortable
    • jQuery UI: Sortable
    • http://jqueryui.com/sortable/
    • Reorder elements in a list or grid using the mouse.
  • ui.tabs
    • jQuery UI: Tabs
    • http://jqueryui.com/tabs/
    • A single content area with multiple panels, each associated with a header in a list.
  • ui.widget
    • jQuery UI: Widget
    • http://learn.jquery.com/jquery-ui/widget-factory/
    • The jQuery UI Widget Factory is an extensible base on which all of jQuery UI's widgets are built.
  • effects
    • jQuery UI: Effects
    • http://jqueryui.com/effect/
  • effects.blind
    • jQuery UI: Effects Blind
    • http://jqueryui.com/effect/
  • effects.bounce
    • jQuery UI: Effects Bounce
    • http://jqueryui.com/effect/
  • effects.clip
    • jQuery UI: Effects Clip
    • http://jqueryui.com/effect/
  • effects.drop
    • jQuery UI: Effects Drop
    • http://jqueryui.com/effect/
  • effects.explode
    • jQuery UI: Effects Explode
    • http://jqueryui.com/effect/
  • effects.fade
    • jQuery UI: Effects Fade
    • http://jqueryui.com/effect/
  • effects.fold
    • jQuery UI: Effects Fold
    • http://jqueryui.com/effect/
  • effects.highlight
    • jQuery UI: Effects Highlight
    • http://jqueryui.com/effect/
  • effects.pulsate
    • jQuery UI: Effects Pulsate
    • http://jqueryui.com/effect/
  • effects.scale
    • jQuery UI: Effects Scale
    • http://jqueryui.com/effect/
  • effects.shake
    • jQuery UI: Effects Shake
    • http://jqueryui.com/effect/
  • effects.slide
    • jQuery UI: Effects Slide
    • http://jqueryui.com/effect/
  • effects.transfer
    • jQuery UI: Effects Transfer
    • http://jqueryui.com/effect/
  • contextual-links
    • Contextual links
    • http://drupal.org/node/473268
    • Drupal's original library. Provides assets for contextual links.

These can be used in the following ways.


$render_array['#attached']['library'][] = [$module_name, $library_name]; // e.g. render_array['#attached']['library'][] = ['system', 'jquery.cookie'];

drupal_add_library($module_name, $library_name); // e.g. drupal_add_library('system', 'jquery.cookie');