HTML CSS Bootstrap JavaScript jQuery MySQL PHP Data Mining

Introduction to jQuery UI

jQuery UI is a powerful, official library of **user interface interactions, effects, widgets, and themes** built on top of the jQuery JavaScript Library. It provides professional-grade components like datepickers, sliders, and draggable elements out of the box.


The Three Main Categories

jQuery UI is divided into three functional groups:

Category Examples
Interactions Draggable, Droppable, Resizable, Selectable, Sortable.
Widgets Datepicker, Accordion, Slider, Progressbar, Dialog, Tabs.
Effects Color animations, Class transitions, advanced Easing.

Installation (via CDN)

To use jQuery UI, you must include the jQuery Library first, followed by the jQuery UI script and its CSS theme file.

<!-- 1. jQuery Core (Required first) -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

<!-- 2. jQuery UI CSS (For styling) -->
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">

<!-- 3. jQuery UI JS (For logic) -->
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>

Interaction Example: Draggable

One of the most popular features of jQuery UI is making any element draggable with only one line of code.

$(function() {
    // Simply call draggable() on any element
    $("#myBox").draggable();
});
ThemeRoller: jQuery UI has a system called ThemeRoller that allows you to download custom skins or build your own to match your website's branding perfectly.

Why use jQuery UI?

  • Speed: Build complex interfaces (like tabs or calendars) in minutes.
  • Consistency: Works exactly the same across all modern browsers.
  • Accessibility: Most widgets are built with keyboard navigation and ARIA support.
  • Lightweight: You can download a "custom bundle" containing only the parts you actually need.
Pro Tip: jQuery UI is no longer the "only" way to build interfaces (with frameworks like React and Vue being popular), but it remains a cornerstone for thousands of business applications and legacy dashboards.

Key Points to Remember

  • jQuery UI is an official extension of the core jQuery library.
  • It requires both a JavaScript file and a CSS file to work.
  • It is divided into Interactions, Widgets, and Effects.
  • The ThemeRoller is the official way to style your components.
  • Always load jQuery Core before jQuery UI.