Blade & HTML

How Blade components and plain HTML relate — an honest account of what is automatic and what is manual.

The short answer: one direction is automatic, the other is manual

How the two doc tabs work

Every component page's Usage section has Blade / HTML tabs. The HTML tab is generated on the spot via Blade::render(), so the documented HTML can never go stale when the library updates. Here is a live one embedded on this page:

<x-button color="primary" icon="rocket">Launch</x-button>
<button class="inline-flex items-center justify-center whitespace-nowrap font-medium tracking-wide transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 rounded-[var(--radius-field)] border-[length:var(--border)] h-[var(--h-field-md)] px-[var(--px-field-md)] text-[length:var(--text-field-md)] gap-2 bg-primary text-primary-content border-primary hover:bg-primary/90 focus-visible:ring-primary cursor-pointer"><svg class="w-4 h-4" viewbox="0 0 24 24">
<path fill="currentColor" fill-rule="evenodd" d="m14.447 16.377l5.847-5.83c.842-.839 1.263-1.259 1.484-1.792S22 7.627 22 6.44v-.567c0-1.826 0-2.739-.569-3.306S19.947 2 18.116 2h-.57c-1.19 0-1.785 0-2.32.221c-.536.221-.957.641-1.8 1.48L7.58 9.531c-.984.98-1.594 1.589-1.83 2.176a1.5 1.5 0 0 0-.112.562c0 .802.647 1.448 1.942 2.739l.174.173l2.038-2.069a.75.75 0 1 1 1.069 1.053L8.816 16.24l.137.137c1.295 1.29 1.943 1.936 2.747 1.936c.178 0 .348-.031.519-.094c.603-.222 1.219-.836 2.228-1.842m2.747-6.846a1.946 1.946 0 0 1-2.747 0a1.93 1.93 0 0 1 0-2.738a1.946 1.946 0 0 1 2.747 0a1.93 1.93 0 0 1 0 2.738" clip-rule="evenodd"></path>
<path fill="currentColor" d="M9.034 5.963L6.491 8.5c-.467.466-.896.893-1.235 1.28a6 6 0 0 0-.619.82l-.024-.025l-.095-.094a4.9 4.9 0 0 0-1.532-1.004l-.123-.05l-.379-.15a.764.764 0 0 1-.259-1.252C3.345 6.907 4.69 5.566 5.34 5.297a3.4 3.4 0 0 1 1.788-.229c.546.081 1.063.362 1.907.895m4.342 13.35c.205.208.34.355.464.512q.243.311.434.658c.142.26.253.537.474 1.092a.69.69 0 0 0 1.126.224l.084-.083c1.12-1.117 2.465-2.458 2.735-3.105a3.35 3.35 0 0 0 .229-1.782c-.081-.545-.362-1.06-.897-1.902l-2.552 2.544c-.478.477-.916.914-1.313 1.256c-.237.206-.497.41-.784.586" opacity=".3"></path></svg> Launch</button>

Using only the HTML side (projects without Blade)

The HTML tab's output is plain HTML plus class strings, so you can copy it into a project that doesn't use Blade. Two things are required:

  • The compiled CSS — the classes reference theme tokens (bg-primary, …) and tune tokens (p-md, var(--radius-box), …). The official distribution is currently the Composer package build; a standalone CSS package (npm) is in the works.
  • Alpine.js — the HTML output of dynamic components (modal / tabs / dropdown …) includes their x-data attributes as-is. Load Alpine.js (+ @alpinejs/focus / @alpinejs/collapse) on the page and the copied HTML just works. Static components (button / badge / card …) need no JS at all.

The reverse direction: migrating existing HTML to Blade

There is no automatic converter, but the recipe is simple:

  1. Find the closest component in the catalog previews — Component Catalog →
  2. Copy the minimal example from that page's Blade tab and match the props (color / size / appearance …)
  3. Throw away your hand-written class piles — color, shape, and spacing are handled by the theme and tune

Which components need Alpine

Static (no JS)

button / badge / card / avatar / input / checkbox / progress / tooltip / breadcrumb / stat / timeline / stepper …

Dynamic (Alpine required)

modal / tabs / accordion / dropdown / popover / sidebar / select / alert (dismissible) / notification / collapse …

FAQ

The class strings and structure work as-is (the look is reproduced as long as the CSS is loaded). The x-data interactivity is Alpine's, though — in React/Vue you'd port it to that framework's state. Official multi-framework support is planned as Web Components.

None — it isn't baked. The output classes are semantic tokens (bg-primary, p-md, …), so they follow whatever data-theme / data-tune the destination page uses.

Yes. Every example shown is actually rendered and verified — the HTML tab is the proof; an example that fails to render cannot appear on the page.