Charts & Plugins
AdminLTE 4 deliberately ships a lean dependency tree — no charting, no calendar, no jQuery. Instead it documents best-in-class, jQuery-free third-party libraries you drop in only when you need them. Each loads from a CDN (or npm) and initialises with a few lines of vanilla JS.
The integration pattern
Every integration follows the same three steps: add the library's CSS to <head>, add its JS before </body> (after AdminLTE), add a target element, and initialise it. The demo dashboard pages (dist/index.html, dist/pages/*.html) include the library tags in their <head>/footer and the init code in an inline script at the bottom.
Pin a specific version in CDN URLs so snippets stay reproducible — third-party libraries publish independently of AdminLTE. For production, prefer an npm install through your bundler, or self-host the minified files.
Libraries used by the demos
| Need | Library | Demo page |
|---|---|---|
| Charts | Chart.js | index.html, index2.html, index3.html, charts/chartjs.html |
| Vector maps | jsvectormap | index.html |
| Calendar | FullCalendar | pages/calendar.html |
| Data tables | Tabulator | tables/data.html |
| Drag & drop | SortableJS | pages/kanban.html |
Chart.js
Chart.js (MIT) draws every chart in the demo: the area, line and sparkline charts on the dashboards, grouped columns, doughnuts, the radial progress rings and the mixed bar-and-line chart, plus the Chart.js showcase (charts/chartjs.html). It is loaded only on the pages that draw charts. The admin-lte npm package itself has no chart dependency, so you add Chart.js only if you use it.
Chart.js renders into a <canvas>. Give the canvas a wrapper with a fixed height and let the chart fill it; the preset below sets maintainAspectRatio: false for that reason:
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.5.1/dist/chart.umd.min.js"
integrity="sha256-SERKgtTty1vsDxll+qzd4Y2cF9swY9BCq62i9wXJ9Uo="
crossorigin="anonymous"></script>
<div class="position-relative" style="height: 300px">
<canvas id="revenue-chart" role="img" aria-label="Weekly visits"></canvas>
</div>
<script>
new Chart(document.getElementById("revenue-chart"), {
type: "line",
data: {
labels: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
datasets: [{
label: "Visits",
data: [30, 40, 35, 50, 49, 60, 70],
borderColor: "#0d6efd",
fill: true,
tension: 0.4
}]
},
options: { maintainAspectRatio: false, scales: { y: { beginAtZero: true } } }
});
</script>
Bars use type: "bar" (add indexAxis: "y" for horizontal bars and stacked: true on both scales to stack), and doughnut, pie, radar, polar area, scatter and bubble charts are built in. For a progress ring, draw a doughnut with a large cutout and a reduced circumference/rotation; the showcase page has the radial-bar example.
The chart theme preset
A canvas cannot read CSS, so a chart does not pick up AdminLTE's colours or dark mode on its own. Every charted demo page includes a short preset right after the Chart.js script; its source is src/html/components/_chartjs.astro, and in dist/ it is inlined into index.html, index2.html, index3.html and charts/chartjs.html. Copy that block into your own layout, after Chart.js and before your chart code. It:
- sets
Chart.defaultsfrom AdminLTE's CSS variables: the body font,--bs-secondary-colorfor ticks, faint gridlines with no vertical grid on category axes, rounded bars, circular legend markers, and a tooltip styled like a card; - restyles every chart on the page when
<html data-bs-theme>changes (the ColorMode toggle, the OS preference in auto mode, or your own code) and when the web font finishes loading; - lays out legends and tooltips right-to-left under
<html dir="rtl">; - exposes small helpers for your chart code on
globalThis.lteChartTheme:areaFill(color)(a gradient fill for area charts),alpha(color, opacity),cssVar(name, fallback)andrefresh().
<!-- Chart.js, then the preset block, then your charts -->
<script>
const { areaFill } = globalThis.lteChartTheme
new Chart(document.getElementById("revenue-chart"), {
type: "line",
data: {
labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"],
datasets: [{
label: "Digital Goods",
data: [28, 48, 40, 19, 86, 27, 90],
borderColor: "#0d6efd",
backgroundColor: areaFill("#0d6efd"),
fill: true,
tension: 0.4
}]
}
});
</script>
If you adapt the preset, keep its forgetThemeColors step. Chart.js copies the scale defaults into each chart when the chart is created, so changing Chart.defaults and calling chart.update() leaves existing axes in the old colours. The preset removes those copied colours before it updates. Colours you set on a chart yourself are left alone.
FullCalendar
FullCalendar powers pages/calendar.html — drag-and-drop scheduling and multiple views:
<script src="https://cdn.jsdelivr.net/npm/fullcalendar@6.1.20/index.global.min.js"></script>
<div id="calendar"></div>
<script>
new FullCalendar.Calendar(document.getElementById("calendar"), {
initialView: "dayGridMonth",
headerToolbar: { start: "prev,next today", center: "title",
end: "dayGridMonth,timeGridWeek,listWeek" },
events: [{ title: "Team standup", start: "2026-06-01" }]
}).render();
</script>
jsvectormap
jsvectormap renders the interactive vector map on the dashboard. The demo loads its CSS and JS (plus a maps data file) from jsDelivr:
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/jsvectormap@1.5.3/dist/css/jsvectormap.min.css">
<script src="https://cdn.jsdelivr.net/npm/jsvectormap@1.5.3/dist/js/jsvectormap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jsvectormap@1.5.3/dist/maps/world.js"></script>
<div id="map" style="height: 300px;"></div>
<script>
new jsVectorMap({ selector: "#map", map: "world" });
</script>
Loading order
Put third-party CSS in <head> after AdminLTE's CSS, and put plugin JS at the end of <body> after the AdminLTE bundle, then your init script last:
<!-- ... Bootstrap, AdminLTE JS ... -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.5.1/dist/chart.umd.min.js"></script>
<script>/* the chart theme preset */</script>
<script>/* your chart/calendar/map init code */</script>
AdminLTE ships none of these libraries — keeping the framework footprint small is intentional. The full recommended set (Flatpickr, Tom Select, noUiSlider, Quill, EasyMDE, Dropzone, FilePond, GLightbox, IMask, and more) is documented in the AdminLTE Integrations guide; all are MIT-licensed and jQuery-free.
Coming from AdminLTE 3?
AdminLTE 3 bundled a plugins/ folder of jQuery widgets. None of them ship with v4 — each has a vanilla-JS successor instead:
| AdminLTE 3 (jQuery) | AdminLTE 4 |
|---|---|
| Select2 | Tom Select |
| DataTables | Tabulator |
| Summernote / bootstrap4-wysihtml5 | Quill |
| bootstrap-datepicker / daterangepicker / timepicker | Flatpickr |
| bootstrap-slider | noUiSlider |
| iCheck | native .form-check |
| jQuery InputMask | IMask |
| bootstrap-colorpicker | Pickr |
| jQuery Mapael | jsVectorMap |
| jQuery UI sortable | SortableJS |
| Ekko Lightbox | GLightbox |
Select2 specifically is the one people ask about most. It is still maintained, but it is still a jQuery plugin — there is no jQuery-free build — so v4 recommends Tom Select, which covers search, multi-select, tagging, clearable selections, AJAX-backed options and virtual scrolling in roughly 20 kB gzip against Select2's ~50 kB once jQuery is counted. There is a line-by-line API mapping for porting existing code, and — if you are locked into Select2 — an optional styling-only compatibility theme that makes it match Bootstrap 5.3 without adding jQuery to AdminLTE.
The full replacement table lives in the core migration guide.
Charts that follow dark mode
Chart libraries draw their own text, gridlines and tooltips and know nothing about data-bs-theme. The chart theme preset handles this for Chart.js: it watches the data-bs-theme and dir attributes on <html>, re-reads the CSS variables and updates every chart in place, so there is nothing to wire up per chart. To restyle charts after a change the preset cannot see (for example, new values for the CSS variables), call lteChartTheme.refresh(). If you prefer events, document.addEventListener("changed.lte.color-mode", e => …) receives e.detail.resolved. The dark-mode charts recipe walks through the same approach.
Coming from ApexCharts?
Earlier v4 releases drew the demo charts with ApexCharts. Newer ApexCharts releases are no longer MIT-licensed, so the demo moved to Chart.js and the ApexCharts colour-mode helper was removed from the shared page scripts. The old showcase URL charts/apexcharts.html redirects to charts/chartjs.html. When porting your own charts: an ApexCharts series becomes Chart.js data.datasets, xaxis.categories becomes data.labels, a <div> target becomes a <canvas> inside a sized wrapper, and .render() is not needed.