Live Demo
Below are two tiny, fully working jQuery UI widgets right on this page - a draggable box and a datepicker input. Each of the following tutorial pages goes deep into one interaction or widget at a time.
jQuery UI is an official companion library built on top of jQuery core. Where jQuery core gives you DOM manipulation, events, effects and AJAX, jQuery UI adds a set of ready-made, themeable, accessible widgets (accordion, tabs, dialog, datepicker, slider, tooltip, autocomplete), low-level interactions (draggable, droppable, resizable, selectable, sortable) and extra easings/effects that plain jQuery doesn't ship with.
Building a good date picker, a drag-and-drop sortable list, or an accessible modal dialog from scratch takes real effort: keyboard navigation, ARIA attributes, cross-browser quirks, animation timing. jQuery UI packages all of that into a single, consistent API so you can drop in $('#el').draggable() or $('#el').datepicker() and get a working, themeable widget immediately.
<!-- 1. jQuery UI's CSS theme (after Bootstrap, before your own styles) -->
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
<!-- 2. jQuery core FIRST -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- 3. jQuery UI SECOND (it extends jQuery, so order matters) -->
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
.draggable, .dialog, etc.) onto the existing $.fn object.
$(function(){
// turn a plain text input into a calendar picker
$('#uiIntroDateDemo').datepicker();
// turn a plain div into a draggable box
$('#uiIntroDragDemo').draggable();
});
Every jQuery UI widget is styled purely through CSS classes like ui-widget, ui-state-default and ui-corner-all. The jquery-ui.css file you load from the CDN is just one "theme" - jQuery's official ThemeRoller tool lets you generate a completely different-looking stylesheet (colors, borders, fonts) using the exact same class names, so you can restyle every widget on your site by swapping one CSS file, without touching your JavaScript or markup. This tutorial series uses the default "base" theme; building a custom theme is outside the scope of these pages.
Below are two tiny, fully working jQuery UI widgets right on this page - a draggable box and a datepicker input. Each of the following tutorial pages goes deep into one interaction or widget at a time.
This jQuery UI subsection covers the following interactions and widgets, one per page:
ui-widget, ui-corner-all, ...) can clash visually with other frameworks like Bootstrap. Load jQuery UI's stylesheet after Bootstrap's, as shown above, so its widget styles take precedence for the elements you initialize.