Theme
Design your own
On this page (6)

§Three sizes

All three load the same component code. They differ only in how many files a page requests and how much of the system it downloads. Every way starts with core.css (tokens + utilities); the section and per-component ways also load core.js (the df$ runtime every component binds to), which all.js already embeds.

Ways to load
WayFilesPick it when
allcomponents/all.css + all.jsa page uses components from most sections, or you prototype
sectionsections/{section}.css + .js, plus the sections it needsa page lives in one or two areas - a form, a dashboard, a landing page
componentcomponents/{name}/{name}.css + .jsa page uses a handful of components and you list them yourself

The Installation page covers all and per-component loading; this page covers the section bundles and the downloads.

§The section bundles

Every component sits in exactly one sidebar section, and every sidebar section that holds components ships as one bundle: dist/sections/{section}.css, plus .js when a member has behavior, plus the minified twins and source maps. The WYSIWYG Editors section is the extra bundle components/wysiwyg.* that every page of this documentation loads. A section bundle holds only its own components, so loading several sections never ships a component twice.

Needs lists the other sections whose components the section's documented markup uses: a Website pricing block is built from Buttons and Badges, a Dialog from Buttons. The list is computed from every html block of the members' component skills, plus the markup their JavaScript writes. Primitives appears almost everywhere because it carries Typography, the page's base text size. Sizes are minified + gzip-compressed, CSS and JS together, without core.

dist/sections - one bundle per sidebar section
SectionComponentsNeedsFilesSizeZIP
Guides3 · motion, anim-canvas, parallaxPrimitives, Data Displaysections/guides.css
sections/guides.js
5.8 KiBguides.zip
Primitives7Actions, Data Display, Chartssections/primitives.css
sections/primitives.js
6.5 KiBprimitives.zip
Actions7Primitives, Overlayssections/actions.css
sections/actions.js
5.9 KiBactions.zip
Forms & Inputs17Primitives, Actionssections/forms-inputs.css
sections/forms-inputs.js
19.6 KiBforms-inputs.zip
WYSIWYG Editors2 · code-example, editorjsPrimitives, Actions, Forms & Inputs, Applicationcomponents/wysiwyg.css
components/wysiwyg.js
17.8 KiBwysiwyg.zip
Questionnaire1 · questionnairePrimitives, Actions, Forms & Inputssections/questionnaire.css
sections/questionnaire.js
11.2 KiBquestionnaire.zip
Data Display19Primitives, Actions, Forms & Inputssections/data-display.css
sections/data-display.js
36.4 KiBdata-display.zip
Big Data4 · virtual-list, data-tree, data-grid, autocompletePrimitives, Forms & Inputssections/big-data.css
sections/big-data.js
16.0 KiBbig-data.zip
Charts1 · chartPrimitivessections/charts.css
sections/charts.js
4.4 KiBcharts.zip
Diagrams2 · diagram, mermaidPrimitives, Actionssections/diagrams.css
sections/diagrams.js
26.8 KiBdiagrams.zip
Feedback & Status7Primitives, Actions, Overlayssections/feedback-status.css
sections/feedback-status.js
9.4 KiBfeedback-status.zip
Overlays7Primitives, Actions, Data Displaysections/overlays.css
sections/overlays.js
7.2 KiBoverlays.zip
Navigation11Primitives, Actions, Data Display, Overlayssections/navigation.css
sections/navigation.js
16.9 KiBnavigation.zip
Application7Primitives, Actions, Forms & Inputs, Data Display, Overlayssections/application.css
sections/application.js
24.0 KiBapplication.zip
Chat4 · bubble, marker, message, sessionPrimitives, Actions, Forms & Inputs, Data Display, Feedback & Statussections/chat.css
sections/chat.js
7.1 KiBchat.zip
Mockup1 · mockup-codePrimitivessections/mockup.css1.9 KiBmockup.zip
Presentations1 · presentationGuides, Primitives, Chartssections/presentations.css
sections/presentations.js
4.9 KiBpresentations.zip
Papers2 · paper, bibtexPrimitives, Actions, Data Displaysections/papers.css
sections/papers.js
9.4 KiBpapers.zip
Website129Primitives, Actions, Forms & Inputs, Data Display, Feedback & Status, Overlays, Navigation, Mockupsections/website.css
sections/website.js
59.1 KiBwebsite.zip
flowchart LR
    Core["core.css + core.js<br/>tokens, utilities, df$ runtime"] --> Needs["dependent code:<br/>everything from the section's Needs column"]
    Needs --> Section["the complete section bundle"]
Fig 1. Every bundle expects the core to be loaded first; it bundles dependent code from the sections listed in the Needs column, then the section's code itself.

§From the CDN

Load core, then the sections it needs, then the section - the order in the diagram. For the Overlays section that is 90.4 KiB minified and compressed, against 288.1 KiB for core.css + all.css + all.js:

<!-- Overlays: core first, then the sections it needs, then the section -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/kyr0/defuss-shadcn@latest/dist/components/core.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/kyr0/defuss-shadcn@latest/dist/sections/primitives.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/kyr0/defuss-shadcn@latest/dist/sections/actions.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/kyr0/defuss-shadcn@latest/dist/sections/data-display.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/kyr0/defuss-shadcn@latest/dist/sections/overlays.min.css">
<script type="module" src="https://cdn.jsdelivr.net/gh/kyr0/defuss-shadcn@latest/dist/components/core.min.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/gh/kyr0/defuss-shadcn@latest/dist/sections/primitives.min.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/gh/kyr0/defuss-shadcn@latest/dist/sections/actions.min.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/gh/kyr0/defuss-shadcn@latest/dist/sections/data-display.min.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/gh/kyr0/defuss-shadcn@latest/dist/sections/overlays.min.js"></script>

Each section bundle binds to the runtime core.js installed, so core.js comes first; its components then initialize themselves, including ones added to the page later. Replace @latest with a release tag to lock the version (see Pinning a version), and drop .min from a file name for the readable source.

§With a package manager

The npm package ships the same dist/ tree. Import the same files in the same order, once, in the app entry:

// Overlays: core first, then the sections it needs, then the section
import 'defuss-shadcn/dist/components/core.css';
import 'defuss-shadcn/dist/sections/primitives.css';
import 'defuss-shadcn/dist/sections/actions.css';
import 'defuss-shadcn/dist/sections/data-display.css';
import 'defuss-shadcn/dist/sections/overlays.css';
import 'defuss-shadcn/dist/components/core.js';
import 'defuss-shadcn/dist/sections/primitives.js';
import 'defuss-shadcn/dist/sections/actions.js';
import 'defuss-shadcn/dist/sections/data-display.js';
import 'defuss-shadcn/dist/sections/overlays.js';

§Download a ZIP (vendoring)

For a project that cannot reach a CDN or a registry - an offline build, a locked-down network, a CMS theme folder - every GitHub release attaches one ZIP per section and one for all. The links in the table above point at the release of this page's version. Each ZIP is complete on its own: core, every section the chosen one needs, and the section, as readable files, minified files and source maps, with the license, the third-party notice and a README that shows the load order.

defuss-shadcn-vX.Y.Z-overlays/
├-- README.md               ← what is inside + the <link>/<script> tags in load order
├-- LICENSE
├-- NOTICE.txt              ← bundled third-party code (defuss-morph, defuss-query)
├-- components/
│   ├-- core.css            ← + core.min.css, core.min.css.map
│   └-- core.js             ← + core.js.map, core.min.js, core.min.js.map
└-- sections/
    ├-- primitives.css / .js ← the sections Overlays needs, each with its twins
    ├-- actions.css / .js
    ├-- data-display.css / .js
    └-- overlays.css / .js   ← the section itself

Unzip the folder into your static files and copy the tags from its README. The all.zip ZIP holds core.css and all.* - all.js embeds the runtime, so it has no core.js. Releases up to v0.9.5 predate the split and attach no ZIPs; for the whole repository (sources, docs and all), use the source archive GitHub attaches to every release, or the Self-hosting download.

§How the split is made

The sidebar is the source: scripts/lib/sections.ts reads it, assigns each component to the one section that links its page, and fails the build when a component is in no section or in two. scripts/bundle.ts builds the bundles, bun run verify checks that each carries exactly its members and no copy of the core runtime, and dist/stats.json records members, needs and sizes - this page renders from it. scripts/release-zips.ts packs the ZIPs from the same data when a release is cut.

Comments, ideas or improvements? Edit this page's source on GitHub