# Pastebin pMDIrWAd use Air::Functional :BASE; use Air::Base; use Air::Component; my &index = &page.assuming( #:REFRESH(5), title => 'hÅrc', description => 'HTMX, Air, Red, Cro', footer => footer p ['Aloft on ', b 'Åir'], ); class Downloader does Component { has Int $.count = 0; method download is controller { do the download return some HTML } method hx-download(--> Hash()) { :hx-get("downloader/$.id/download"), :hx-target("#downloader-$.id"), :hx-swap, :hx-trigger, } method HTML { button :id("downloader-$.id"), } } my $downloader = Downloader; sub SITE is export { site :register[$downloader], #:theme-color, index main form |$downloader.hx-download, [ h3 'Download:'; ~$downloader; button :type, '+'; ] }