Daisy alpine
Building HTML artifacts and web UI components using DaisyUI 5, Tailwind CSS 4, and Alpine.js. Use when creating single-file web applications, dashboards, interactive prototypes, or browser-based tools. Covers DaisyUI component syntax, Alpine.js V3 patterns, and key migration notes from Alpine V2.From its SKILL.md
npx -y skills add mehrlander/web-tools --skill daisy-alpineAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
9.1 KB, as published. Nobody here has run it
DaisyUI + Alpine.js Reference
Component reference and patterns for building browser-based UI with DaisyUI 5 (Tailwind CSS 4) and Alpine.js.
House style: read this before laying out a page
This file covers how to build. These cover what to build, and they are not
preferences to weigh. Each one is here because the same correction kept being issued
by hand. Full statement and reasoning: docs/HTML-STYLE.md in mehrlander/web-tools.
- No stat cards. A row of tiles, each a label over a big number, is the default
output of a model asked to build a dashboard and is nearly always wrong. It takes
the top of the page and the reader's attention and returns no relationship for it:
a tile isolates its number by construction, with no comparison, baseline, or
denominator, and meaning in data lives in relationships. That is what makes it an
easy button, glossy and shallow in one gesture, the cheapest thing that photographs
like rigor. Put a headline figure in the header as one compact line or behind a
control, and where figures deserve room give them a form that holds a comparison.
Treat any
stats,stat-value, or KPI-tile grid as a defect. - No explanatory prose. GitHub doesn't explain and neither should we. Use structure,
labels, and controls to show relationships: a range control starting at 2015 says the
data starts in 2015. Explanatory prose is unfinished work: unused ideas, loitering.
Its tell is text narrowed to a reading column (
max-w-*plusmx-auto,max-w-prose,container mx-auto); what you will usually find is that the text does not belong on the page at all. - Browsing is a full-viewport takeover. A deck, gallery, diff, or result set is
fixed inset-0withgrid-rows-[auto_1fr_auto]: thin header, content, thin footer. Not a boxed widget with page furniture around it. A page another page may embed takes the same shape without the fixed root:min-h-dvhplussticky top-0/sticky bottom-0chrome over normal flow, because a fixed root inside an iframe measures against the outer viewport on Safari and its right-hand column is cut off in any host narrower than the window. - Type is for reading, not for fitting. If type shrank to fit, the layout is wrong,
not the type. Decks and documents run
text-xl+ withleading-8; dense working surfaces run smaller. Two tiers only, content and chrome: everything the reader came to read gets the same size, andtext-xsbelongs to counters, timestamps, and labels. - Content starts at the top. Never vertically centre a slide because it looks balanced when short; across a deck it moves the first line on every card.
- One accent, and it means something. Colour carries information, not decoration. In a comparison, each side keeps a fixed treatment across every view.
References
- DaisyUI 5 components: See
references/daisyui.mdfor complete component syntax, class names, and usage rules - Alpine.js V3 patterns: See
references/alpine-v3.mdfor V3 API and key differences from V2 - Reactivity cost in long lists: See
references/reactivity-cost.mdfor the per-row binding pattern that scales badly with N, the direct-DOM fix, and the DOM-reuse gotcha - Full demo: See
references/demo-sortable.htmlfor a complete working example demonstrating CDN usage, DaisyUI components, Alpine.js patterns, Phosphor Icons, and third-party library integration
Key Conventions
-
Use CDN delivery (jsDelivr for Tailwind/DaisyUI/libraries, unpkg for Alpine): no build step
-
Single-file artifacts: inline styles and scripts
-
DaisyUI semantic colors (
primary,base-100, etc.) over Tailwind color names -
Alpine's
x-data,x-show,x-bindfor reactivity: no React -
Use Phosphor Icons via CDN for iconography: no inline SVGs
-
No
<style>blocks: no vanilla CSS, no<style type="text/tailwindcss">, no@apply. Generally, avoid all efforts to override styles in third-party components. -
A daisyUI semantic colour works only in the utility families daisyUI itself ships.
bg-base-200,text-base-content, andborder-base-300resolve;divide-base-200does not, because daisyUI ships nodivide-*and Tailwind has nobase-200in its own colour theme, so the utility compiles to nothing and is dropped silently. Tailwind v4 then defaultsborder-colortocurrentColor(v3 defaulted togray-200), sodivide-yalone paints hairlines in the text colour: black lines where a faint grey was intended. The same trap waits inring-*,outline-*, andaccent-*. Separate rows withgap, or write the border explicitly ([&>*+*]:border-t [&>*+*]:border-base-200). A Tailwind palette name (divide-slate-300) also works and is the tell: if swapping the colour name fixes it, the semantic name was never compiling. Inside anx-for, reach for the index rather than the adjacency selector; see 8. -
Structural selectors are wrong inside an
x-for, including the adjacency fix above. Alpine inserts each clone after the<template>rather than replacing it, so the template stays in the DOM and occupies the parent's first child slot. Measured with jsdom against the real runtime, three rows in a bare parent:children: template,span,span,span :first-child matches a clone? false (the template is :first-child) :last-child matches a clone? true (only while nothing follows the loop) :scope > * + * hits: span,span,spanSo
first:matches nothing at all,last:matches only when the loop is the last thing in its parent (add a footer under it and that silently stops too), and[&>*+*]:border-tputs a border on every row including the first, because the first clone's preceding sibling is the template. All three compile and all three are real CSS, so nothing warns; the rule just lands on the wrong element or on none.Take the position from the loop, which is the one source that knows it:
x-for="(row, i) in rows"then:class="{ 'border-t border-base-200': i }". Or separate withgapon a flex/grid parent, which is ordinal-free. Reservefirst:/last:/[&>*+*]:for static markup. -
A daisyUI control does not fill its parent, and a phone is where you find out.
.inputand.textareacompute towidth: clamp(3rem, 20rem, 100%), so in a column narrower than 20rem they look correct and in a wider one they stop short while their label runs on. Measured at a 390px viewport: the label 342px, the field 320px, a ragged right edge down the whole form. Putw-fullon every input, textarea, and select rather than relying on the flex parent to stretch it, sincealign-self: stretchdoes not apply to an item with an explicit width. -
Size a pane by its container, not by the viewport. A pane that is half a screen on desktop and the whole screen on a phone cannot be laid out with
sm:/lg:, which ask how wide the window is: the samelg:grid-cols-6that reads well full-width puts six columns in a 360px column when the pane is split. Put@containeron the column and use@md:/@xl:, which ask how wide the column is. The variants degrade to one column where they are unsupported, which is the safe direction. -
Tailwind v4 layers its utilities; the typography stylesheet is unlayered, and unlayered wins.
.prose{max-width:65ch}therefore beats.max-w-noneon the cascade-layer rule rather than on specificity, and nothing in the class list looks wrong. Reach for!max-w-none, or keep the 65ch measure on purpose and centre the column. Preferlib/kits/guide-render.jsfor anything new, which brings its own CSS and sidesteps this; do not convert a working surface just for symmetry.
CDN Patterns
Use jsDelivr combine to bundle multiple packages in a single request. Tailwind, DaisyUI, icons, and any other libraries go through jsDelivr. Alpine goes through unpkg; when plugins join, a jsDelivr combine keeps them one tag with core last.
Scripts (jsDelivr combine)
<script src="https://cdn.jsdelivr.net/combine/npm/@tailwindcss/browser@4,npm/@phosphor-icons/web,npm/clipboard"></script>
Styles (jsDelivr combine)
<link href="https://cdn.jsdelivr.net/combine/npm/daisyui@5/themes.css,npm/daisyui@5" rel="stylesheet" />
Alpine + plugins (jsDelivr combine, defer)
<script defer src="https://cdn.jsdelivr.net/combine/npm/@alpinejs/collapse/dist/cdn.min.js,npm/@alpinejs/sort/dist/cdn.min.js,npm/alpinejs/dist/cdn.min.js"></script>
Alpine core must load last when combining with plugins. Use defer so Alpine initializes after the DOM is ready.
Phosphor Icons
Use <i class="ph ph-icon-name"> for regular weight, ph-bold, ph-fill, etc. for variants. Avoids inline SVGs entirely.
<i class="ph ph-caret-down"></i>
<i class="ph ph-file-text"></i>
<i class="ph ph-check"></i>